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