comerrors

package
v1.60.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProviderError

type ProviderError struct {
	Provider   comdom.ProviderType
	Kind       ProviderErrorKind
	StatusCode int
	Message    string
	Err        error
}

ProviderError is the common error format for all AI providers.

func NewProviderError

func NewProviderError(provider comdom.ProviderType, statusCode int, message string, err error) *ProviderError

func NewProviderTransportError

func NewProviderTransportError(provider comdom.ProviderType, err error) *ProviderError

func (*ProviderError) Error

func (e *ProviderError) Error() string

func (*ProviderError) Unwrap

func (e *ProviderError) Unwrap() error

type ProviderErrorKind

type ProviderErrorKind string

ProviderErrorKind identifies the user-facing category of a provider error.

const (
	ProviderLimitErrorKind          ProviderErrorKind = "ai-provider-limit"
	ProviderAuthErrorKind           ProviderErrorKind = "ai-provider-auth"
	ProviderPermissionErrorKind     ProviderErrorKind = "ai-provider-permission"
	ProviderRequestErrorKind        ProviderErrorKind = "ai-provider-request"
	ProviderUnavailableErrorKind    ProviderErrorKind = "ai-provider-unavailable"
	ProviderContentBlockedErrorKind ProviderErrorKind = "ai-provider-content-blocked"
	ProviderTimeoutErrorKind        ProviderErrorKind = "ai-provider-timeout"
)

func ClassifyProviderError

func ClassifyProviderError(statusCode int, message string) ProviderErrorKind

type ProviderLimitError

type ProviderLimitError = ProviderError

ProviderLimitError is kept as a compatibility alias.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL