errorOrNull property

L? get errorOrNull

Returns the error value, or null if this is a Success.

Implementation

L? get errorOrNull {
  return switch (this) {
    Success<L, R>() => null,
    Failure<L, R>(value: final l) => l,
  };
}