onError property

  1. @override
ErrorCallback? onError
override

A callback that is invoked when an unhandled error occurs in the root isolate.

This callback must return true if it has handled the error. Otherwise, it must return false and a fallback mechanism such as printing to stderr will be used, as configured by the specific platform embedding via Settings::unhandled_exception_callback.

The VM or the process may exit or become unresponsive after calling this callback. The callback will not be called for exceptions that cause the VM or process to terminate or become unresponsive before the callback can be invoked.

This callback is not directly invoked by errors in child isolates of the root isolate. Programs that create new isolates must listen for errors on those isolates and forward the errors to the root isolate.

Implementation

@override
ErrorCallback? get onError => _platformDispatcher.onError;
  1. @override
void onError=(ErrorCallback? value)
override

Implementation

@override
set onError(ErrorCallback? value) {
  _platformDispatcher.onError;
}