catchAsyncError method
Catch it if the initAsync() throws an error The FutureBuilder will fail, but you can examine the error
Implementation
@override
void catchAsyncError(Object error) {
try {
onCatchAsyncError(error);
} catch (e) {
final details = FlutterErrorDetails(
exception: e,
stack: e is Error ? e.stackTrace : null,
library: 'app_state.dart',
context: ErrorDescription('Exception in onCatchAsyncError()'),
);
logErrorDetails(details);
}
try {
inCatchAsyncError?.call(error);
} catch (e) {
final details = FlutterErrorDetails(
exception: e,
stack: e is Error ? e.stackTrace : null,
library: 'app_state.dart',
context: ErrorDescription('Exception in inCatchAsyncError()'),
);
logErrorDetails(details);
}
}