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" 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.
Click to show internal directories.
Click to hide internal directories.