errorOrNull property

Failure? get errorOrNull

The wrapped failure, or null if this is a Success.

Implementation

Failure? get errorOrNull => switch (this) {
      Success<T>() => null,
      Error<T>(:final failure) => failure,
    };