Documentation
¶
Overview ¶
Package errors defines standard error types used across llm-router services.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotFound is returned when a requested resource does not exist ErrNotFound = errors.New("not found") // ErrAlreadyExists is returned when attempting to create a duplicate resource ErrAlreadyExists = errors.New("already exists") // ErrInvalidInput is returned when input validation fails ErrInvalidInput = errors.New("invalid input") ErrUnauthorized = errors.New("unauthorized") // ErrForbidden is returned for authorization failures ErrForbidden = errors.New("forbidden") // ErrModelNotAllowed is returned when a token's rules forbid the requested model ErrModelNotAllowed = errors.New("model not allowed by token rules") // ErrProviderNotAllowed is returned when a token's rules forbid the requested provider ErrProviderNotAllowed = errors.New("provider not allowed by token rules") // ErrCredentialNotAllowed is returned when a token's rules forbid all credentials for a provider ErrCredentialNotAllowed = errors.New("no allowed credential available for provider") // ErrNoCredential is returned when no credential is available for a provider ErrNoCredential = errors.New("no credential available for provider") // ErrProviderNotFound is returned when no provider can handle a given ModelId ErrProviderNotFound = errors.New("provider not found for model") // ErrProviderDisabled is returned when the provider is switched off ErrProviderDisabled = errors.New("provider is disabled") // ErrModelDisabled is returned when an admin override disables the requested model ErrModelDisabled = errors.New("model is disabled by administrator") // ErrEndpointNotSupported is returned when the provider or model does // not serve the requested endpoint (e.g. audio/transcriptions) ErrEndpointNotSupported = errors.New("endpoint not supported") )
Standard sentinel errors
Functions ¶
func NewNotFoundError ¶
NewNotFoundError creates a NotFoundError
func NewValidationError ¶
NewValidationError creates a ValidationError
Types ¶
type NotFoundError ¶
NotFoundError wraps ErrNotFound with context about what was not found
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
func (*NotFoundError) Unwrap ¶
func (e *NotFoundError) Unwrap() error
type ValidationError ¶
ValidationError wraps ErrInvalidInput with details about what failed validation
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
func (*ValidationError) Unwrap ¶
func (e *ValidationError) Unwrap() error
Click to show internal directories.
Click to hide internal directories.