normalize

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package normalize provides shared provider error normalization helpers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeError

func DecodeError(provider string, err error) error

DecodeError wraps decode/parsing failures as provider-specific decode errors.

func NetworkError

func NetworkError(provider string, err error) error

NetworkError wraps transport failures as provider-specific network errors.

func OpenAIStyleProviderError

func OpenAIStyleProviderError(provider string, status int, body []byte, requestID string) error

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

func SentinelForStatus(status int) error

SentinelForStatus maps an HTTP status code to a core sentinel error.

func SentinelForStatusWithOverrides

func SentinelForStatusWithOverrides(status int, overrides map[int]error) error

SentinelForStatusWithOverrides maps an HTTP status code to a core sentinel error, then applies any exact status overrides from the provided map.

Types

This section is empty.

Jump to

Keyboard shortcuts

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