Documentation
¶
Overview ¶
Package aigoerr provides structured, classifiable errors for aigo engines. Agents can use IsRetryable and GetCode to make informed retry decisions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsRetryable ¶
IsRetryable checks the error chain for a retryable *Error. When no structured *Error is found, it falls back to IsTransientNative to detect Go-native transient errors (timeouts, network failures).
func IsTransientNative ¶ added in v0.27.0
IsTransientNative reports whether err is a Go-native transient error that is safe to retry (timeout, network failure, unexpected EOF). It does NOT check for *aigoerr.Error — use IsRetryable for that.
Types ¶
type Error ¶
type Error struct {
Code Code
StatusCode int
Message string
Retryable bool
RetryAfter time.Duration
Err error // wrapped original
}
Error is a structured error carrying classification metadata.
func FromHTTPResponse ¶
FromHTTPResponse creates a classified Error from an HTTP response. prefix is prepended to the message (e.g., "newapi", "openai").