executeProtectedResult<S> function
Result unwrapping version of executeProtected. Where func
returns an Result, but can still throw.
Implementation
Result<S, Object> executeProtectedResult<S>(Result<S, Object> Function() func) {
try {
return func();
} catch (e) {
return Err(e);
}
}