simplified error handler

This commit is contained in:
Your Name 2026-02-09 17:01:00 +01:00
parent 77f62396e0
commit 7728498bf9

View file

@ -24,20 +24,6 @@ class ErrorHandler {
onError?.call(error, stackTrace);
}
/// Convenience method to wrap code that might throw exceptions
T handleError<T>(T Function() operation, {T? defaultValue}) {
try {
return operation();
} catch (error, stackTrace) {
notify(error, stackTrace);
if (defaultValue != null) {
return defaultValue;
}
rethrow;
}
}
}
/// Global instance of ErrorHandler for easy access