catchError method

void catchError(
  1. Exception? ex
)

Catch and explicitly handle the error.

Implementation

void catchError(Exception? ex) {
  if (ex == null) {
    return;
  }

  /// If a tester is running. Don't handle the error.
  if (WidgetsBinding.instance is WidgetsFlutterBinding) {
    FlutterError.onError!(FlutterErrorDetails(exception: ex));
  }
}