Documentation
¶
Overview ¶
Package normalize provides shared provider error normalization helpers.
Index ¶
- func DecodeError(provider string, err error) error
- func NetworkError(provider string, err error) error
- func OpenAIStyleProviderError(provider string, status int, body []byte, requestID string) error
- func ProviderError(provider string, status int, requestID, code, message string, sentinel error) error
- func SentinelForStatus(status int) error
- func SentinelForStatusWithOverrides(status int, overrides map[int]error) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeError ¶
DecodeError wraps decode/parsing failures as provider-specific decode errors.
func NetworkError ¶
NetworkError wraps transport failures as provider-specific network errors.
func OpenAIStyleProviderError ¶
OpenAIStyleProviderError normalizes providers that use OpenAI-style error envelopes.
func ProviderError ¶
func ProviderError(provider string, status int, requestID, code, message string, sentinel error) error
ProviderError constructs a normalized ProviderError. If message is empty, HTTP status text is used. If sentinel is nil, default status-based mapping is applied.
func SentinelForStatus ¶
SentinelForStatus maps an HTTP status code to a core sentinel error.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.