Documentation
¶
Index ¶
- type AppError
- func IsAppError(err error) (*AppError, bool)
- func NewAgentInvalidMaxIterationsError() *AppError
- func NewAgentInvalidTemperatureError() *AppError
- func NewAgentMissingAllowedToolsError() *AppError
- func NewAgentMissingThinkingModelError() *AppError
- func NewBadRequestError(message string) *AppError
- func NewConflictError(message string) *AppError
- func NewForbiddenError(message string) *AppError
- func NewInternalServerError(message string) *AppError
- func NewNotFoundError(message string) *AppError
- func NewTenantNotFoundError() *AppError
- func NewUnauthorizedError(message string) *AppError
- func NewValidationError(message string) *AppError
- type ErrorCode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppError ¶
type AppError struct {
Code ErrorCode `json:"code"`
Message string `json:"message"`
Details any `json:"details,omitempty"`
HTTPCode int `json:"-"`
}
AppError defines the application error structure
func IsAppError ¶
IsAppError checks if the error is an AppError type
func NewAgentInvalidMaxIterationsError ¶
func NewAgentInvalidMaxIterationsError() *AppError
func NewAgentInvalidTemperatureError ¶
func NewAgentInvalidTemperatureError() *AppError
func NewAgentMissingAllowedToolsError ¶
func NewAgentMissingAllowedToolsError() *AppError
func NewAgentMissingThinkingModelError ¶
func NewAgentMissingThinkingModelError() *AppError
Agent related errors
func NewBadRequestError ¶
NewBadRequestError creates a bad request error
func NewConflictError ¶
NewConflictError creates a conflict error
func NewForbiddenError ¶
NewForbiddenError creates a forbidden error
func NewInternalServerError ¶
NewInternalServerError creates an internal server error
func NewNotFoundError ¶
NewNotFoundError creates a not found error
func NewUnauthorizedError ¶
NewUnauthorizedError creates an unauthorized error
func NewValidationError ¶
NewValidationError creates a validation error
func (*AppError) WithDetails ¶
WithDetails adds error details
type ErrorCode ¶
type ErrorCode int
ErrorCode defines the error code type
const ( // Common error codes (1000-1999) ErrBadRequest ErrorCode = 1000 ErrForbidden ErrorCode = 1002 ErrNotFound ErrorCode = 1003 ErrMethodNotAllowed ErrorCode = 1004 ErrConflict ErrorCode = 1005 ErrTooManyRequests ErrorCode = 1006 ErrInternalServer ErrorCode = 1007 ErrTimeout ErrorCode = 1009 ErrValidation ErrorCode = 1010 // Tenant related error codes (2000-2099) ErrTenantNotFound ErrorCode = 2000 ErrTenantAlreadyExists ErrorCode = 2001 ErrTenantInactive ErrorCode = 2002 ErrTenantNameRequired ErrorCode = 2003 ErrTenantInvalidStatus ErrorCode = 2004 // Agent related error codes (2100-2199) ErrAgentMissingThinkingModel ErrorCode = 2100 ErrAgentMissingAllowedTools ErrorCode = 2101 ErrAgentInvalidMaxIterations ErrorCode = 2102 ErrAgentInvalidTemperature ErrorCode = 2103 )
System error codes
Click to show internal directories.
Click to hide internal directories.