runCatchingResult<T> function
Implementation
Future<Result<T>> runCatchingResult<T>(
FutureOr<Result<T>> Function() fn,
) async {
try {
return fn();
} catch (e, stackTrace) {
return Result.errorWithCause(e.toString(), e, stackTrace);
}
}