tryEither<T> function
- T block(
- BindEither bind
Implementation
Result<T> tryEither<T>(T Function(BindEither bind) block) {
A bind<A>(Result<A> either) => either.fold((e) => throw e, identity);
try {
return Either.right(block(bind));
} on Exception catch (e) {
return Either.left(e);
}
}