Generated reference · Error catalog
Error & failure catalog
The platform's typed error surfaces — error codes, failure modes, and retryable/terminal degradation, parsed from source.
43 codes3 typed surfaces5 retryable
On this page
The platform’s typed error surfaces — the subsystems that declare their failures as enumerable codes, generated from source so the catalog stays in lockstep. Each entry names the failure and, where the subsystem declares it, whether it is retryable or terminal — the contract a caller routes on (retry, failover, surface-to-user, page on-call).
43 Error codes
3 Typed surfaces
5 Retryable
8 Terminal
retryable safe to retry / failover-eligible · terminal not retryable without a change · HTTP nnn the status a client sees. Scope: this is the catalog of subsystems with a declared, typed error surface — not every error the platform can raise; ad-hoc failures live in each subsystem’s deep-dive (§7), not a fabricated central table.
LLM gateway (19) # The typed error hierarchy emitted by the LLM gateway. Callers instanceof these to decide retry, failover, surface-to-user, or page-on-call — so retryable is the contract, not a hint. source .
authenticationLLMAuthenticationError terminal # Auth failure — missing/expired API key. Not retryable without rotation.
cancelledLLMCancelledError terminal # Caller cancelled via `AbortSignal`. Not retryable.
circuit_breaker_openLLMCircuitBreakerOpenError retryable # Circuit breaker open — provider is being skipped. Failover-eligible.
context_length_exceededLLMContextLengthExceededError terminal # Input + max-output exceeds the model's context window. Not retryable.
invalid_requestLLMInvalidRequestError terminal # Malformed request — schema validation, missing required fields, etc.
networkLLMNetworkError retryable # Network-layer failure (DNS, TCP, TLS, connection reset). Retryable.
provider_unavailableLLMProviderUnavailableError retryable # Provider returned 5xx or socket failed. Retryable / failover-eligible.
quota_exceededLLMQuotaError terminal # Per-tenant quota cap reached. Not retryable in-window.
rate_limitLLMRateLimitError retryable # * @oshun/contracts/llm - Error Taxonomy * * Typed error hierarchy emitted by `IsisLLMClient`. Consumers `instanceof` * these classes to make routing decisions (retry, fallback, surface to * user, page on-call). Every error carries `code`, `provider`, `model`, * `requestId`, `retryable`, and an optional `retryAfterMs`. */ import { z } from 'zod'; import { LLMProviderSchema, LLMRequestIdSchema, type LLMProvider, type LLMRequestId, } from './primitives'; // ============================================================================ // Error code enumeration (used by both error classes and persisted records) // ============================================================================ export const LLMErrorCodeSchema = z.enum([ 'rate_limit', 'quota_exceeded', 'context_length_exceeded', 'invalid_request', 'authentication', 'authorization', 'safety_filter', 'content_filter', 'provider_unavailable', 'circuit_breaker_open', 'timeout', 'cancelled', 'network', 'malformed_response', 'unsupported_model', 'unsupported_capability', 'tool_validation', 'structured_output_validation', 'unknown', ]); export type LLMErrorCode = z.infer<typeof LLMErrorCodeSchema>; /** Persisted error record (e.g., for audit logs / replay). */ export const LLMErrorRecordSchema = z.object({ code: LLMErrorCodeSchema, provider: LLMProviderSchema, model: z.string().min(1).max(120).nullable(), requestId: LLMRequestIdSchema.nullable(), message: z.string().min(1).max(4000), retryable: z.boolean(), retryAfterMs: z.number().int().min(0).nullable().default(null), upstreamStatus: z.number().int().min(0).max(599).nullable().default(null), upstreamCode: z.string().min(1).max(200).nullable().default(null), occurredAtEpochMs: z.number().int().min(0), }); export type LLMErrorRecord = z.infer<typeof LLMErrorRecordSchema>; // ============================================================================ // Base class // ============================================================================ export interface LLMErrorOptions { readonly provider: LLMProvider; readonly model: string | null; readonly requestId: LLMRequestId | null; readonly retryable?: boolean; readonly retryAfterMs?: number | null; readonly upstreamStatus?: number | null; readonly upstreamCode?: string | null; readonly cause?: unknown; } /** Base class. All gateway errors extend this. */ export class LLMError extends Error { public readonly code: LLMErrorCode; public readonly provider: LLMProvider; public readonly model: string | null; public readonly requestId: LLMRequestId | null; public readonly retryable: boolean; public readonly retryAfterMs: number | null; public readonly upstreamStatus: number | null; public readonly upstreamCode: string | null; public readonly occurredAtEpochMs: number; constructor(code: LLMErrorCode, message: string, options: LLMErrorOptions) { super(message, options.cause !== undefined ? { cause: options.cause } : undefined); this.name = this.constructor.name; this.code = code; this.provider = options.provider; this.model = options.model; this.requestId = options.requestId; this.retryable = options.retryable ?? false; this.retryAfterMs = options.retryAfterMs ?? null; this.upstreamStatus = options.upstreamStatus ?? null; this.upstreamCode = options.upstreamCode ?? null; this.occurredAtEpochMs = Date.now(); } /** Serialise to a `LLMErrorRecord` for logging / persistence. */ toRecord(): LLMErrorRecord { return { code: this.code, provider: this.provider, model: this.model, requestId: this.requestId, message: this.message, retryable: this.retryable, retryAfterMs: this.retryAfterMs, upstreamStatus: this.upstreamStatus, upstreamCode: this.upstreamCode, occurredAtEpochMs: this.occurredAtEpochMs, }; } } // ============================================================================ // Concrete subclasses // ============================================================================ /** 429 / token-bucket exhaustion. Always retryable.
safety_filterLLMSafetyFilterError terminal # Provider-side safety filter blocked the request or response. Not retryable.
structured_output_validationLLMStructuredOutputValidationError terminal # Structured-output reply failed JSON-schema validation.
timeoutLLMTimeoutError retryable # Request exceeded `LLMRequest.timeoutMs`. Retryable.
Neith API (5) # The HTTP-facing error registry for the Neith inverse-modeling API — each code carries a stable identifier, HTTP status, and the failure it names. The full record (causes, resolutions, worked example) lives in source. source .
NEITH-ASSET-001Asset Too Large HTTP 413 # The uploaded asset exceeds the maximum file size limit for your plan.
NEITH-ASSET-002Asset Not Found HTTP 404 # The requested asset does not exist or has been deleted.
NEITH-AUTH-001Authentication Required HTTP 401 # The request requires a valid API key or Bearer token. None was provided or the provided credential is invalid.
NEITH-AUTH-002Insufficient Permissions HTTP 403 # The authenticated user does not have permission to perform the requested operation on this resource.
NEITH-RATE-001Rate Limit Exceeded HTTP 429 # You have exceeded the API rate limit. Requests are throttled per API key.
The Uzume media pipeline namespaces every failure under a SUBSYSTEM-NNN code across 19 subsystems, so an operator can route a failure to its owning subsystem from the code alone. source .
Codes follow <SUBSYSTEM>-<NNN> (a 001–999 sequence per subsystem); the 19 subsystem prefixes are listed above.