Nexus
1.x
Docs/Nexus/Errors
Open

Reading1 min
Updated31 Jul 2026
Sourcev1/concepts/errors.mdx

Nexus defines sentinel errors in the root package. These are used throughout the codebase and mapped to HTTP status codes in the API layer.

Error Values01

var (
    ErrProviderNotFound    = errors.New("nexus: provider not found")
    ErrModelNotFound       = errors.New("nexus: model not found")
    ErrNoProviderAvailable = errors.New("nexus: no provider available")
    ErrAuthRequired        = errors.New("nexus: authentication required")
    ErrForbidden           = errors.New("nexus: forbidden")
    ErrTenantRequired      = errors.New("nexus: tenant context required")
    ErrTenantNotFound      = errors.New("nexus: tenant not found")
    ErrTenantDisabled      = errors.New("nexus: tenant disabled")
    ErrGuardrailBlocked    = errors.New("nexus: blocked by guardrail")
    ErrCacheMiss           = errors.New("nexus: cache miss")
    ErrRateLimited         = errors.New("nexus: rate limit exceeded")
    ErrBudgetExceeded      = errors.New("nexus: budget exceeded")
    ErrTokenOverflow       = errors.New("nexus: token limit exceeded")
    ErrAliasNotFound       = errors.New("nexus: alias not found")
)

HTTP Mapping02

The API layer maps these errors to standard HTTP responses:

ErrorHTTP Status
ErrAuthRequired401 Unauthorized
ErrForbidden403 Forbidden
ErrProviderNotFound404 Not Found
ErrTenantNotFound404 Not Found
ErrGuardrailBlocked400 Bad Request
ErrRateLimited429 Too Many Requests
ErrBudgetExceeded402 Payment Required
ErrTokenOverflow413 Payload Too Large