inspectErr method
Calls action with the error, and returns this result unchanged.
final saved = const Err<int, String>('locked')
.inspectErr((error) => print('save failed: $error'));
Implementation
Result<T, E> inspectErr(void Function(E error) action) {
if (this case Err<T, E>(:final error)) action(error);
return this;
}