runGuarded<R> static method
Wraps specified function with automatic errors and exceptions interception (using runZonedGuarded() with onError handler).
Implementation
static R? runGuarded<R>(
R Function() body, BugseeGenericErrorCallback errorCallback) {
return runZonedGuarded<R>(() {
return body();
}, (error, stackTrace) async {
await _exceptionHandler?.logException(error, false, stackTrace);
await errorCallback(error, stackTrace);
});
}