Documentation
¶
Index ¶
- func IsAuthError(err error) bool
- func IsNotFound(err error) bool
- func IsRateLimitError(err error) bool
- func IsTimeout(err error) bool
- type AppError
- func Errorf(code ErrorCode, format string, args ...interface{}) *AppError
- func NewAgentInitError(err error) *AppError
- func NewAgentProcessError(err error) *AppError
- func NewAppError(code ErrorCode, message string) *AppError
- func NewConfigInvalidError(err error, field string) *AppError
- func NewConfigNotFoundError(path string) *AppError
- func NewGatewayConnectError(err error, platform string) *AppError
- func NewGatewayDisconnectError(err error, platform string) *AppError
- func NewGatewayInitError(err error) *AppError
- func NewGatewayMessageError(err error) *AppError
- func NewInternalError(err error) *AppError
- func NewInvalidInputError(msg string) *AppError
- func NewPermissionDeniedError() *AppError
- func NewProviderAuthError() *AppError
- func NewProviderCallError(err error) *AppError
- func NewProviderNotFoundError(name string) *AppError
- func NewProviderRateLimitError(provider string) *AppError
- func NewSessionCreateError(err error) *AppError
- func NewSessionExpiredError(id string) *AppError
- func NewSessionNotFoundError(id string) *AppError
- func NewSkillExecutionError(err error, name string) *AppError
- func NewSkillLoadError(err error, name string) *AppError
- func NewSkillNotFoundError(name string) *AppError
- func NewToolExecutionError(err error) *AppError
- func NewToolInvalidParamsError(name string) *AppError
- func NewToolNotFoundError(name string) *AppError
- func NewToolTimeoutError(name string) *AppError
- func NewUnauthorizedError() *AppError
- func WithMessage(code ErrorCode, message string) *AppError
- func Wrap(err error, code ErrorCode, message string) *AppError
- func WrapError(err error, code ErrorCode, format string, args ...interface{}) *AppError
- type ErrorCode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsAuthError ¶
IsAuthError checks if the error is an authentication error
func IsNotFound ¶
IsNotFound checks if the error is a not found error
func IsRateLimitError ¶
IsRateLimitError checks if the error is a rate limit error
Types ¶
type AppError ¶
AppError represents an application error with code
func Errorf ¶
Errorf creates a new AppError with formatted message. This is a drop-in replacement for fmt.Errorf that uses AppError format. Usage: errors.Errorf(errors.ErrCodeInvalidInput, "invalid value: %s", value)
func NewAgentInitError ¶
NewAgentInitError creates an agent initialization error
func NewAgentProcessError ¶
NewAgentProcessError creates an agent process error
func NewAppError ¶
NewAppError creates a new AppError
func NewConfigInvalidError ¶
NewConfigInvalidError creates a config invalid error
func NewConfigNotFoundError ¶
NewConfigNotFoundError creates a config not found error
func NewGatewayConnectError ¶
NewGatewayConnectError creates a gateway connect error
func NewGatewayDisconnectError ¶
NewGatewayDisconnectError creates a gateway disconnect error
func NewGatewayInitError ¶
NewGatewayInitError creates a gateway init error
func NewGatewayMessageError ¶
NewGatewayMessageError creates a gateway message error
func NewInternalError ¶
NewInternalError creates an internal error
func NewInvalidInputError ¶
NewInvalidInputError creates an invalid input error
func NewPermissionDeniedError ¶
func NewPermissionDeniedError() *AppError
NewPermissionDeniedError creates a permission denied error
func NewProviderAuthError ¶
func NewProviderAuthError() *AppError
NewProviderAuthError creates a provider auth error
func NewProviderCallError ¶
NewProviderCallError creates a provider call error
func NewProviderNotFoundError ¶
NewProviderNotFoundError creates a provider not found error
func NewProviderRateLimitError ¶
NewProviderRateLimitError creates a provider rate limit error
func NewSessionCreateError ¶
NewSessionCreateError creates a session create error
func NewSessionExpiredError ¶
NewSessionExpiredError creates a session expired error
func NewSessionNotFoundError ¶
NewSessionNotFoundError creates a session not found error
func NewSkillExecutionError ¶
NewSkillExecutionError creates a skill execution error
func NewSkillLoadError ¶
NewSkillLoadError creates a skill load error
func NewSkillNotFoundError ¶
NewSkillNotFoundError creates a skill not found error
func NewToolExecutionError ¶
NewToolExecutionError creates a tool execution error
func NewToolInvalidParamsError ¶
NewToolInvalidParamsError creates a tool invalid parameters error
func NewToolNotFoundError ¶
NewToolNotFoundError creates a tool not found error
func NewToolTimeoutError ¶
NewToolTimeoutError creates a tool timeout error
func NewUnauthorizedError ¶
func NewUnauthorizedError() *AppError
NewUnauthorizedError creates an unauthorized error
func WithMessage ¶
WithMessage creates an AppError with just a message, using ErrCodeInternalError.
type ErrorCode ¶
type ErrorCode string
ErrorCode represents an error code
const ( // General errors ErrCodeUnknown ErrorCode = "UNKNOWN" ErrCodeInvalidInput ErrorCode = "INVALID_INPUT" ErrCodeInternalError ErrorCode = "INTERNAL_ERROR" ErrCodeNotFound ErrorCode = "NOT_FOUND" ErrCodeTimeout ErrorCode = "TIMEOUT" ErrCodePermissionDenied ErrorCode = "PERMISSION_DENIED" // Agent errors ErrCodeAgentInit ErrorCode = "AGENT_INIT_FAILED" ErrCodeAgentProcess ErrorCode = "AGENT_PROCESS_FAILED" ErrCodeAgentTimeout ErrorCode = "AGENT_TIMEOUT" // Tool errors ErrCodeToolNotFound ErrorCode = "TOOL_NOT_FOUND" ErrCodeToolExecution ErrorCode = "TOOL_EXECUTION_FAILED" ErrCodeToolTimeout ErrorCode = "TOOL_TIMEOUT" ErrCodeToolInvalidParams ErrorCode = "TOOL_INVALID_PARAMS" // Provider errors ErrCodeProviderInit ErrorCode = "PROVIDER_INIT_FAILED" ErrCodeProviderCall ErrorCode = "PROVIDER_CALL_FAILED" ErrCodeProviderAuth ErrorCode = "PROVIDER_AUTH_FAILED" ErrCodeProviderRateLimit ErrorCode = "PROVIDER_RATE_LIMIT" ErrCodeProviderNotFound ErrorCode = "PROVIDER_NOT_FOUND" // Gateway errors ErrCodeGatewayInit ErrorCode = "GATEWAY_INIT_FAILED" ErrCodeGatewayConnect ErrorCode = "GATEWAY_CONNECT_FAILED" ErrCodeGatewayDisconnect ErrorCode = "GATEWAY_DISCONNECT_FAILED" ErrCodeGatewayMessage ErrorCode = "GATEWAY_MESSAGE_FAILED" // Session errors ErrCodeSessionNotFound ErrorCode = "SESSION_NOT_FOUND" ErrCodeSessionCreate ErrorCode = "SESSION_CREATE_FAILED" ErrCodeSessionExpired ErrorCode = "SESSION_EXPIRED" // Skill errors ErrCodeSkillNotFound ErrorCode = "SKILL_NOT_FOUND" ErrCodeSkillLoad ErrorCode = "SKILL_LOAD_FAILED" ErrCodeSkillExecution ErrorCode = "SKILL_EXECUTION_FAILED" // Config errors ErrCodeConfigNotFound ErrorCode = "CONFIG_NOT_FOUND" ErrCodeConfigInvalid ErrorCode = "CONFIG_INVALID" )
Error codes