catchTrace method
Future<T>
catchTrace(
- void onError(
- Object? error,
- StackTrace trace
- bool test(
- Object error
Handles errors, and provides the stack trace emitted by this Future.
This is identical to calling:
future.catchError(onError);
... except that the type signature of onError
is strengthened. For
historic reasons, the original type signature accepts functions that
will always throw at runtime or have unexpected behavior.
Implementation
Future<T> catchTrace(
void Function(Object? error, StackTrace trace) onError, {
bool Function(Object error)? test,
}) {
return catchError(onError, test: test);
}