catching<T> static method
Executes a function and catches any exceptions, returning them as failures
Implementation
static Result<T, Exception> catching<T>(T Function() action) {
try {
return Result.success(action());
} on Exception catch (e) {
return Result.failure(e);
}
}