Called when asset loading or the WebSocket reports an error.
final void Function(Object error)? onError;