LiterLlmError class sealed
- Available extensions
- Annotations
-
- @freezed
Constructors
- LiterLlmError.authentication({required String message, required PlatformInt64 status})
-
statuspreserves the exact HTTP status code received (401 or 403).constfactory - LiterLlmError.badRequest({required String message, required PlatformInt64 status})
-
statuspreserves the exact HTTP status code received (400, 405, 413, 422, …).constfactory - LiterLlmError.budgetExceeded({required String message, required String model})
-
constfactory
- LiterLlmError.contentPolicy({required String message})
-
constfactory
- LiterLlmError.contextWindowExceeded({required String message})
-
constfactory
- LiterLlmError.endpointNotSupported({required String endpoint, required String provider})
-
constfactory
- LiterLlmError.hookRejected({required String message})
-
constfactory
- LiterLlmError.idempotencyConflict({required String key})
-
A different request body was submitted for an existing
Idempotency-Key.constfactory - LiterLlmError.idempotencyInFlight({required String key})
-
The same
Idempotency-Keyis already in-flight (another request with the same key is currently being processed).constfactory - LiterLlmError.internalError({required String message})
-
An internal logic error (e.g. unexpected Tower response variant).
constfactory
- LiterLlmError.invalidHeader({required String name, required String reason})
-
constfactory
- LiterLlmError.notFound({required String message})
-
constfactory
- LiterLlmError.outboundForbidden({required String url, required String reason})
-
An outbound request was blocked by the active
OutboundPolicy.constfactory - LiterLlmError.rateLimited({required String message, required PlatformInt64 retryAfter})
-
constfactory
- LiterLlmError.serialization({required String field0})
-
constfactory
- LiterLlmError.serverError({required String message, required PlatformInt64 status})
-
statuspreserves the exact HTTP status code received (500, or other 5xx not covered byServiceUnavailable).constfactory -
statuspreserves the exact HTTP status code received (502, 503, or 504).constfactory - LiterLlmError.streaming({required String message})
-
A catch-all for errors that occur during streaming response processing.
constfactory
- LiterLlmError.timeout()
-
constfactory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
errorType(
) → Future< String> -
Return the OpenTelemetry
error.typestring for this error variant. -
isTransient(
) → Future< bool> -
Returns
truefor errors that are worth retrying on a different service or deployment (transient failures). -
map<
TResult extends Object?> ({required TResult authentication(LiterLlmError_Authentication value), required TResult rateLimited(LiterLlmError_RateLimited value), required TResult badRequest(LiterLlmError_BadRequest value), required TResult contextWindowExceeded(LiterLlmError_ContextWindowExceeded value), required TResult contentPolicy(LiterLlmError_ContentPolicy value), required TResult notFound(LiterLlmError_NotFound value), required TResult serverError(LiterLlmError_ServerError value), required TResult timeout(LiterLlmError_Timeout value), required TResult streaming(LiterLlmError_Streaming value), required TResult endpointNotSupported(LiterLlmError_EndpointNotSupported value), required TResult invalidHeader(LiterLlmError_InvalidHeader value), required TResult serialization(LiterLlmError_Serialization value), required TResult budgetExceeded(LiterLlmError_BudgetExceeded value), required TResult hookRejected(LiterLlmError_HookRejected value), required TResult internalError(LiterLlmError_InternalError value), required TResult outboundForbidden(LiterLlmError_OutboundForbidden value), required TResult idempotencyConflict(LiterLlmError_IdempotencyConflict value), required TResult idempotencyInFlight(LiterLlmError_IdempotencyInFlight value)}) → TResult -
Available on LiterLlmError, provided by the LiterLlmErrorPatterns extension
Aswitch-like method, using callbacks. -
mapOrNull<
TResult extends Object?> ({TResult? authentication(LiterLlmError_Authentication value)?, TResult? rateLimited(LiterLlmError_RateLimited value)?, TResult? badRequest(LiterLlmError_BadRequest value)?, TResult? contextWindowExceeded(LiterLlmError_ContextWindowExceeded value)?, TResult? contentPolicy(LiterLlmError_ContentPolicy value)?, TResult? notFound(LiterLlmError_NotFound value)?, TResult? serverError(LiterLlmError_ServerError value)?, TResult? timeout(LiterLlmError_Timeout value)?, TResult? streaming(LiterLlmError_Streaming value)?, TResult? endpointNotSupported(LiterLlmError_EndpointNotSupported value)?, TResult? invalidHeader(LiterLlmError_InvalidHeader value)?, TResult? serialization(LiterLlmError_Serialization value)?, TResult? budgetExceeded(LiterLlmError_BudgetExceeded value)?, TResult? hookRejected(LiterLlmError_HookRejected value)?, TResult? internalError(LiterLlmError_InternalError value)?, TResult? outboundForbidden(LiterLlmError_OutboundForbidden value)?, TResult? idempotencyConflict(LiterLlmError_IdempotencyConflict value)?, TResult? idempotencyInFlight(LiterLlmError_IdempotencyInFlight value)?}) → TResult? -
Available on LiterLlmError, provided by the LiterLlmErrorPatterns extension
A variant ofmapthat fallback to returningnull. -
maybeMap<
TResult extends Object?> ({TResult authentication(LiterLlmError_Authentication value)?, TResult rateLimited(LiterLlmError_RateLimited value)?, TResult badRequest(LiterLlmError_BadRequest value)?, TResult contextWindowExceeded(LiterLlmError_ContextWindowExceeded value)?, TResult contentPolicy(LiterLlmError_ContentPolicy value)?, TResult notFound(LiterLlmError_NotFound value)?, TResult serverError(LiterLlmError_ServerError value)?, TResult timeout(LiterLlmError_Timeout value)?, TResult streaming(LiterLlmError_Streaming value)?, TResult endpointNotSupported(LiterLlmError_EndpointNotSupported value)?, TResult invalidHeader(LiterLlmError_InvalidHeader value)?, TResult serialization(LiterLlmError_Serialization value)?, TResult budgetExceeded(LiterLlmError_BudgetExceeded value)?, TResult hookRejected(LiterLlmError_HookRejected value)?, TResult internalError(LiterLlmError_InternalError value)?, TResult outboundForbidden(LiterLlmError_OutboundForbidden value)?, TResult idempotencyConflict(LiterLlmError_IdempotencyConflict value)?, TResult idempotencyInFlight(LiterLlmError_IdempotencyInFlight value)?, required TResult orElse()}) → TResult -
Available on LiterLlmError, provided by the LiterLlmErrorPatterns extension
A variant ofmapthat fallback to returningorElse. -
maybeWhen<
TResult extends Object?> ({TResult authentication(String message, PlatformInt64 status)?, TResult rateLimited(String message, PlatformInt64 status)?, TResult badRequest(String message, PlatformInt64 status)?, TResult contextWindowExceeded(String message)?, TResult contentPolicy(String message)?, TResult notFound(String message)?, TResult serverError(String message, PlatformInt64 status)?, TResult timeout()?, TResult streaming(String message)?, TResult endpointNotSupported(String endpoint, String provider)?, TResult invalidHeader(String endpoint, String provider)?, TResult serialization(String message)?, TResult budgetExceeded(String endpoint, String provider)?, TResult hookRejected(String message)?, TResult internalError(String message)?, TResult outboundForbidden(String endpoint, String provider)?, TResult idempotencyConflict(String message)?, TResult idempotencyInFlight(String message)?, required TResult orElse()}) → TResult -
Available on LiterLlmError, provided by the LiterLlmErrorPatterns extension
A variant ofwhenthat fallback to anorElsecallback. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
statusCode(
) → Future< PlatformInt64> - Returns the canonical HTTP status code associated with this error.
-
toString(
) → String -
A string representation of this object.
inherited
-
when<
TResult extends Object?> ({required TResult authentication(String message, PlatformInt64 status), required TResult rateLimited(String message, PlatformInt64 status), required TResult badRequest(String message, PlatformInt64 status), required TResult contextWindowExceeded(String message), required TResult contentPolicy(String message), required TResult notFound(String message), required TResult serverError(String message, PlatformInt64 status), required TResult timeout(), required TResult streaming(String message), required TResult endpointNotSupported(String endpoint, String provider), required TResult invalidHeader(String endpoint, String provider), required TResult serialization(String message), required TResult budgetExceeded(String endpoint, String provider), required TResult hookRejected(String message), required TResult internalError(String message), required TResult outboundForbidden(String endpoint, String provider), required TResult idempotencyConflict(String message), required TResult idempotencyInFlight(String message)}) → TResult -
Available on LiterLlmError, provided by the LiterLlmErrorPatterns extension
Aswitch-like method, using callbacks. -
whenOrNull<
TResult extends Object?> ({TResult? authentication(String message, PlatformInt64 status)?, TResult? rateLimited(String message, PlatformInt64 status)?, TResult? badRequest(String message, PlatformInt64 status)?, TResult? contextWindowExceeded(String message)?, TResult? contentPolicy(String message)?, TResult? notFound(String message)?, TResult? serverError(String message, PlatformInt64 status)?, TResult? timeout()?, TResult? streaming(String message)?, TResult? endpointNotSupported(String endpoint, String provider)?, TResult? invalidHeader(String endpoint, String provider)?, TResult? serialization(String message)?, TResult? budgetExceeded(String endpoint, String provider)?, TResult? hookRejected(String message)?, TResult? internalError(String message)?, TResult? outboundForbidden(String endpoint, String provider)?, TResult? idempotencyConflict(String message)?, TResult? idempotencyInFlight(String message)?}) → TResult? -
Available on LiterLlmError, provided by the LiterLlmErrorPatterns extension
A variant ofwhenthat fallback to returningnull
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited