Versions in this module Expand all Collapse all v0 v0.1.1 May 14, 2026 Changes in this version + var DefaultErrorStrategiesConfig = ConfigFile + var DefaultStrategy = ErrorStrategy + var ErrAgentAlreadyStarted = errors.New("agent already started") + var ErrAgentBusy = errors.New("agent is busy") + var ErrAgentNotFound = errors.New("agent not found") + var ErrAgentNotReady = errors.New("agent not ready") + var ErrAgentNotRunning = errors.New("agent not running") + var ErrAgentPanic = errors.New("agent internal panic") + var ErrAgentTimeout = errors.New("agent execution timeout") + var ErrBackpressureTriggered = errors.New("backpressure triggered") + var ErrBufferFull = errors.New("write buffer is full") + var ErrCircuitBreakerOpen = errors.New("circuit breaker is open") + var ErrDBConnectionFailed = errors.New("database connection failed") + var ErrDBTimeout = errors.New("database operation timeout") + var ErrDependencyCycle = errors.New("task dependency cycle detected") + var ErrDispatchFailed = errors.New("task dispatch failed") + var ErrDispatchNotInitialized = errors.New("task dispatcher not initialized") + var ErrHeartbeatMissed = errors.New("heartbeat missed") + var ErrInvalidAge = errors.New("invalid age") + var ErrInvalidArgument = errors.New("invalid argument provided") + var ErrInvalidBudget = errors.New("invalid budget range") + var ErrInvalidInput = errors.New("invalid input parameter") + var ErrInvalidMessage = errors.New("invalid message format") + var ErrInvalidState = errors.New("invalid state") + var ErrInvalidUserID = errors.New("invalid user ID") + var ErrLLMGenerateFailed = errors.New("LLM generate failed") + var ErrLLMInvalidResponse = errors.New("LLM invalid response") + var ErrLLMParserFailed = errors.New("LLM output parsing failed") + var ErrLLMQuotaExceeded = errors.New("LLM quota exceeded") + var ErrLLMRequestFailed = errors.New("LLM request failed") + var ErrLLMTimeout = errors.New("LLM response timeout") + var ErrLLMValidationFailed = errors.New("LLM output validation failed") + var ErrMaxRetriesExceeded = errors.New("max retries exceeded") + var ErrMaxStepsExceeded = errors.New("agent max steps exceeded") + var ErrMessageTimeout = errors.New("message send timeout") + var ErrNilPointer = errors.New("nil pointer error") + var ErrNoTransaction = errors.New("no active transaction") + var ErrNotImplemented = errors.New("feature not implemented yet") + var ErrProfileParserNotInitialized = errors.New("profile parser not initialized") + var ErrProfileParsingFailed = errors.New("profile parsing failed") + var ErrProfileValidationFailed = errors.New("profile validation failed") + var ErrPromptRenderFailed = errors.New("prompt render failed") + var ErrQueryFailed = errors.New("query execution failed") + var ErrQueueClosed = errors.New("message queue is closed") + var ErrQueueEmpty = errors.New("message queue is empty") + var ErrQueueFull = errors.New("message queue is full") + var ErrQueueNotInitialized = errors.New("message queue not initialized") + var ErrRateLimitExceeded = errors.New("rate limit exceeded") + var ErrRecordNotFound = errors.New("record not found") + var ErrResultAggNotInitialized = errors.New("result aggregator not initialized") + var ErrSecretExpired = errors.New("secret has expired") + var ErrServiceUnavailable = errors.New("service is temporarily unavailable") + var ErrTaskExecutionFailed = errors.New("task execution failed") + var ErrTaskPlannerNotInitialized = errors.New("task planner not initialized") + var ErrTaskQueueFull = errors.New("task queue is full") + var ErrTokenBucketExhausted = errors.New("token bucket exhausted") + var ErrToolNotFound = errors.New("tool not found") + var ErrTransactionFailed = errors.New("transaction failed") + var ErrVectorSearchFailed = errors.New("vector search failed") + var ErrWorkflowCyclicDAG = errors.New("workflow has cyclic dependency") + var ErrWorkflowInvalidPhase = errors.New("invalid workflow phase") + var ErrWorkflowLoadFailed = errors.New("workflow load failed") + var ErrWorkflowNotFound = errors.New("workflow not found") + var ModelValidationErrors = map[string]error + func ExportStrategiesToConfig(configPath string) error + func FormatError(err error) string + func GetAlertMessage(code string) string + func GetAllStrategies() map[string]ErrorStrategy + func IsRetryable(err error) bool + func LoadStrategiesFromConfig(configPath string) error + func SetAllowedDir(dir string) + func SetStrategy(code string, strategy ErrorStrategy) error + func ShouldAlert(code string) bool + func ShouldDLQ(code string) bool + type AlertFunc func(ctx context.Context, message string) + type AppError struct + Code *ErrorCode + Context map[string]any + Err error + func New(code *ErrorCode) *AppError + func Wrap(err error, code *ErrorCode) *AppError + func (e *AppError) Error() string + func (e *AppError) IsRetryable() bool + func (e *AppError) ShouldRetry(attempt int) bool + func (e *AppError) Unwrap() error + func (e *AppError) WithContext(key string, value any) *AppError + type ConfigFile struct + Strategies map[string]ErrorStrategy + Version string + type DLQFunc func(ctx context.Context, msg *DLQMessage) error + type DLQMessage struct + Context map[string]any + Error error + ErrorCode string + RetryCount int + Timestamp time.Time + type ErrorCode struct + Backoff time.Duration + Code string + HTTPStatus int + Message string + Module string + Retry bool + RetryMax int + func NewErrorCode(code, message, module string, retry bool, retryMax int, backoff time.Duration, ...) *ErrorCode + type ErrorStrategy struct + AlertEnabled bool + AlertMessage string + Backoff time.Duration + DLQEnabled bool + MaxRetries int + func GetStrategy(code string) ErrorStrategy + type Handler struct + func NewHandler(dlq DLQFunc, alertFunc AlertFunc) *Handler + func (h *Handler) HandleError(ctx context.Context, appErr *AppError, retryCount int) + func (h *Handler) RetryWithBackoff(ctx context.Context, appErr *AppError, attempt int, fn func() error) error + type InvalidStrategyError struct + Field string + Message string + func (e *InvalidStrategyError) Error() string