ioGuardResult<T> static method
Implementation
static FutureResult<T, IoError> ioGuardResult<T>(
FutureResult<T, IoError> Function() fn) async {
try {
return await fn();
} on IOException catch (e) {
return Err(IoError.ioException(e));
} catch (e) {
return Err(IoError.unknown(e));
}
}