failureOrNull property

E? get failureOrNull

Returns the error if this is a failure, null otherwise

Implementation

E? get failureOrNull => switch (this) {
  Success() => null,
  Failure(error: final error) => error,
};