catchError method
void
catchError(
- Object? ex, {
- StackTrace? stack,
- String? library,
- DiagnosticsNode? context,
- IterableFilter<
String> ? stackFilter, - InformationCollector? informationCollector,
- bool? silent,
Catch and explicitly handle the error.
Implementation
void catchError(
Object? ex, {
StackTrace? stack,
String? library,
DiagnosticsNode? context,
IterableFilter<String>? stackFilter,
InformationCollector? informationCollector,
bool? silent,
}) {
if (ex is! Exception) {
ex = Exception(ex.toString());
}
appState?.catchError(
ex,
stack: stack,
// Supply the app's name instead.
library: library ?? App.packageInfo?.appName,
context: context,
stackFilter: stackFilter,
informationCollector: informationCollector,
silent: silent ?? false,
);
}