getOrThrow method

T getOrThrow()

Throws the underlying ApiError if this is a Failure. Use sparingly — prefer fold for normal control flow.

Implementation

T getOrThrow() => switch (this) {
      Success<T>(:final value) => value,
      Failure<T>(:final error) => throw error,
    };