errorOrNull property

E? get errorOrNull

Returns the error if it exists, otherwise null

Implementation

E? get errorOrNull => switch (this) {
      Error(error: final v) => v,
      _ => null,
    };