errors

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoAgents       = &CrewError{Code: "NO_AGENTS", Message: "crew must have at least one agent"}
	ErrNoTasks        = &CrewError{Code: "NO_TASKS", Message: "crew must have at least one task"}
	ErrAgentNil       = &CrewError{Code: "AGENT_NIL", Message: "task agent cannot be nil"}
	ErrLLMFailed      = &CrewError{Code: "LLM_FAILED", Message: "LLM call failed"}
	ErrMaxIterations  = &CrewError{Code: "MAX_ITER", Message: "agent reached max iterations"}
	ErrMaxRPM         = &CrewError{Code: "MAX_RPM", Message: "rate limit exceeded"}
	ErrInvalidProcess = &CrewError{Code: "INVALID_PROCESS", Message: "unsupported process type"}
	ErrToolFailed     = &CrewError{Code: "TOOL_FAILED", Message: "tool execution failed"}
	ErrGuardrail      = &CrewError{Code: "GUARDRAIL", Message: "output failed guardrail check"}
	ErrTaskFailed     = &CrewError{Code: "TASK_FAILED", Message: "task execution failed"}
	ErrNoMatchingPath = &CrewError{Code: "NO_MATCHING_PATH", Message: "no matching path for task output condition"}
	ErrCycleDetected  = &CrewError{Code: "CYCLE_DETECTED", Message: "flow DAG contains a cycle"}
	// @sk-task production-features#T1.1: sentinel errors for checkpoint (AC-013)
	ErrCheckpointNotFound = &CrewError{Code: "CHECKPOINT_NOT_FOUND", Message: "checkpoint not found"}

	// @sk-task async-crew-execution#T1.2: add sentinel error ErrCrewBusy (AC-010)
	ErrCrewBusy = &CrewError{Code: "CREW_BUSY", Message: "crew is already executing asynchronously"}

	// @sk-task replay-system#T1.1: add sentinel error ErrTaskNotFound (AC-003)
	ErrTaskNotFound = &CrewError{Code: "TASK_NOT_FOUND", Message: "task not found in checkpoint"}

	// @sk-task file-io-tools#T1.1: add sentinel errors ErrPathTraversal and ErrStringNotFound (AC-002, AC-007)
	ErrPathTraversal  = &CrewError{Code: "PATH_TRAVERSAL", Message: "path escapes the allowed root directory"}
	ErrStringNotFound = &CrewError{Code: "STRING_NOT_FOUND", Message: "search string not found in file"}
)

Sentinel errors for common crew failure modes.

Functions

func Is

func Is(err error, target *CrewError) bool

Is checks whether an error matches a target CrewError by comparing error codes.

Types

type CrewError

type CrewError struct {
	Code    string
	Message string
	Err     error
}

CrewError is a structured error type with a code, message, and optional wrapped error.

func Wrap

func Wrap(err *CrewError, msg string) *CrewError

Wrap wraps a CrewError with an additional context message.

func WrapE

func WrapE(err *CrewError, inner error) *CrewError

WrapE wraps a CrewError with an inner error while preserving the original code and message.

func (*CrewError) Error

func (e *CrewError) Error() string

func (*CrewError) Unwrap

func (e *CrewError) Unwrap() error

Jump to

Keyboard shortcuts

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