tryOr<T> function
T
tryOr<T>(
- T worker(),
- T onError
Implementation
T tryOr<T>(T Function() worker, T onError) {
try {
return worker();
} catch (e) {
return onError;
}
}