forked from firka/flutter
Use reportError (over onError) everywhere (#63784)
This commit is contained in:
committed by
GitHub
parent
37ddad61ca
commit
f512e86c2a
@@ -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
|
||||
/// 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);
|
||||
|
||||
/// Called by the Flutter framework before attempting to parse a [StackTrace].
|
||||
|
||||
@@ -401,14 +401,12 @@ abstract class ImageProvider<T extends Object> {
|
||||
};
|
||||
return true;
|
||||
}());
|
||||
if (FlutterError.onError != null) {
|
||||
FlutterError.onError!(FlutterErrorDetails(
|
||||
context: ErrorDescription('while checking the cache location of an image'),
|
||||
informationCollector: collector,
|
||||
exception: exception,
|
||||
stack: stack,
|
||||
));
|
||||
}
|
||||
FlutterError.reportError(FlutterErrorDetails(
|
||||
context: ErrorDescription('while checking the cache location of an image'),
|
||||
informationCollector: collector,
|
||||
exception: exception,
|
||||
stack: stack,
|
||||
));
|
||||
completer.complete(null);
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user