errorOrNull property

Object? get errorOrNull

Returns the exception if Result is Failure or null otherwise.

Implementation

Object? get errorOrNull => switch (this) {
  Failure(error: final error) => error,
  _ => null,
};