error property

NetworkException get error

Unwraps the error; throws StateError if this is a Success.

Implementation

NetworkException get error => switch (this) {
  Failure<T>(error: final e) => e,
  Success<T>() => throw StateError('Called error on a Success result: $this'),
};