Enum LlmException.ErrorType
- All Implemented Interfaces:
Comparable<LlmException.ErrorType>
- Enclosing class:
LlmException
Coarse-grained classification of every failure path the
client can surface. Stable -- new variants are appended at
the end; existing variants do not change semantics.
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescription401 / 403 -- API key invalid, revoked, or lacks access to the requested model.400 subtype -- the conversation exceeded the model's context window.400 / 422 -- malformed request, unsupported parameter, image too large, etc.503 / 529 -- the model is temporarily overloaded.DNS, TLS, read-timeout, connection reset -- the request did not reach the provider or did not get a response back.429 -- rate limit hit.5xx other than 503 / 529 -- provider had an internal error.Any failure that doesn't fit the categories above (e.g. JSON parsing of the response failed). -
Method Summary
Modifier and TypeMethodDescriptionstatic LlmException.ErrorTypeReturns the enum constant of this type with the specified name.static LlmException.ErrorType[]values()Returns an array containing the constants of this enum type, in the order they are declared.Methods inherited from class Enum
clone, compareTo, equals, getDeclaringClass, getEnumValues, hashCode, name, ordinal, setEnumValues, toString, valueOf
-
Enum Constant Details
-
AUTH
401 / 403 -- API key invalid, revoked, or lacks access to the requested model. -
RATE_LIMIT
429 -- rate limit hit. Pair withLlmException.getRetryAfterSeconds()to honour the provider's backoff hint when available. -
INVALID_REQUEST
400 / 422 -- malformed request, unsupported parameter, image too large, etc. -
CONTEXT_LENGTH
400 subtype -- the conversation exceeded the model's context window. Drop older turns and retry, or switch to a longer-context model. -
MODEL_OVERLOADED
503 / 529 -- the model is temporarily overloaded. Same recovery as RATE_LIMIT but a different signal source. -
SERVER
5xx other than 503 / 529 -- provider had an internal error. -
NETWORK
DNS, TLS, read-timeout, connection reset -- the request did not reach the provider or did not get a response back. -
UNKNOWN
Any failure that doesn't fit the categories above (e.g. JSON parsing of the response failed). Treat as a generic programming error and logLlmException.getRawBody().
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-