Documentation
¶
Overview ¶
Package apierror 提供 API 错误类型定义,供 api 和 retry 包共享.
这避免了 api 包和 retry 包之间的循环依赖.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrorCategory ¶
type ErrorCategory int
ErrorCategory 是 API 错误的语义分类枚举.
const ( ErrUnknown ErrorCategory = iota ErrAborted ErrTimeout ErrRateLimit ErrOverloaded ErrPromptTooLong ErrMediaTooLarge ErrRequestTooLarge ErrInvalidRequest ErrAuthentication ErrModelNotFound ErrBilling ErrServerError ErrConnection ErrSSL ErrToolMismatch ErrUnexpectedTool ErrDuplicateToolID ErrInvalidModel ErrContentPolicy )
func (ErrorCategory) IsRetryableByDefault ¶
func (c ErrorCategory) IsRetryableByDefault() bool
IsRetryableByDefault 返回该分类是否默认可重试.
func (ErrorCategory) String ¶
func (c ErrorCategory) String() string
String 返回分类的分析用字符串(Datadog tag 等).
Click to show internal directories.
Click to hide internal directories.