Unverified Commit f512e86c authored by Michael Goderbauer's avatar Michael Goderbauer Committed by GitHub

Use reportError (over onError) everywhere (#63784)

parent 37ddad61
...@@ -871,6 +871,9 @@ class FlutterError extends Error with DiagnosticableTreeMixin implements Asserti ...@@ -871,6 +871,9 @@ class FlutterError extends Error with DiagnosticableTreeMixin implements Asserti
/// ///
/// Set this to null to silently catch and ignore errors. This is not /// Set this to null to silently catch and ignore errors. This is not
/// recommended. /// recommended.
///
/// Do not call [onError] directly, instead, call [reportError], which
/// forwards to [onError] if it is not null.
static FlutterExceptionHandler? onError = (FlutterErrorDetails details) => presentError(details); static FlutterExceptionHandler? onError = (FlutterErrorDetails details) => presentError(details);
/// Called by the Flutter framework before attempting to parse a [StackTrace]. /// Called by the Flutter framework before attempting to parse a [StackTrace].
......
...@@ -401,14 +401,12 @@ abstract class ImageProvider<T extends Object> { ...@@ -401,14 +401,12 @@ abstract class ImageProvider<T extends Object> {
}; };
return true; return true;
}()); }());
if (FlutterError.onError != null) { FlutterError.reportError(FlutterErrorDetails(
FlutterError.onError!(FlutterErrorDetails(
context: ErrorDescription('while checking the cache location of an image'), context: ErrorDescription('while checking the cache location of an image'),
informationCollector: collector, informationCollector: collector,
exception: exception, exception: exception,
stack: stack, stack: stack,
)); ));
}
completer.complete(null); completer.complete(null);
} }
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment