waitTryOr<T> function
Returns the result of the given closure
, or default
if an Exception was raised.
Implementation
Future<T?> waitTryOr<T>(T? defaultValue, Future<T?> Function() closure) async {
try {
return await closure();
} on Exception {
return defaultValue;
}
}