Help us shape the future of Go! Take the 2026 Go Developer Survey

errors

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

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

func IsAppError(err error) (*AppError, bool)

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

func NewBadRequestError(message string) *AppError

NewBadRequestError creates a bad request error

func NewConflictError

func NewConflictError(message string) *AppError

NewConflictError creates a conflict error

func NewForbiddenError

func NewForbiddenError(message string) *AppError

NewForbiddenError creates a forbidden error

func NewInternalServerError

func NewInternalServerError(message string) *AppError

NewInternalServerError creates an internal server error

func NewNotFoundError

func NewNotFoundError(message string) *AppError

NewNotFoundError creates a not found error

func NewTenantNotFoundError

func NewTenantNotFoundError() *AppError

Tenant related errors

func NewUnauthorizedError

func NewUnauthorizedError(message string) *AppError

NewUnauthorizedError creates an unauthorized error

func NewValidationError

func NewValidationError(message string) *AppError

NewValidationError creates a validation error

func (*AppError) Error

func (e *AppError) Error() string

Error implements the error interface

func (*AppError) WithDetails

func (e *AppError) WithDetails(details any) *AppError

WithDetails adds error details

type ErrorCode

type ErrorCode int

ErrorCode defines the error code type

const (
	// Common error codes (1000-1999)
	ErrBadRequest         ErrorCode = 1000
	ErrUnauthorized       ErrorCode = 1001
	ErrForbidden          ErrorCode = 1002
	ErrNotFound           ErrorCode = 1003
	ErrMethodNotAllowed   ErrorCode = 1004
	ErrConflict           ErrorCode = 1005
	ErrTooManyRequests    ErrorCode = 1006
	ErrInternalServer     ErrorCode = 1007
	ErrServiceUnavailable ErrorCode = 1008
	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

Jump to

Keyboard shortcuts

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