Documentation
¶
Index ¶
Constants ¶
const ( ErrCodeInvalidInput = "INVALID_INPUT" ErrCodeNotFound = "NOT_FOUND" ErrCodeExecutionFailed = "EXECUTION_FAILED" ErrCodeTimeout = "TIMEOUT" ErrCodeCancelled = "CANCELLED" ErrCodeValidationFailed = "VALIDATION_FAILED" ErrCodeInternal = "INTERNAL_ERROR" ErrCodePermissionDenied = "PERMISSION_DENIED" )
Machine-readable error codes for structured error responses across the CLI and MCP surfaces.
Variables ¶
var ExitFunc = os.Exit
ExitFunc is invoked by the CLI error handler to terminate the process after a structured envelope has been written. It is overridable so tests can observe the exit code (and message) without actually exiting.
Functions ¶
This section is empty.
Types ¶
type CacheUpdateError ¶
type CacheUpdateError struct {
Err error
}
func NewCacheUpdateError ¶
func NewCacheUpdateError(err error) CacheUpdateError
func (CacheUpdateError) Code ¶
func (e CacheUpdateError) Code() string
func (CacheUpdateError) Error ¶
func (e CacheUpdateError) Error() string
func (CacheUpdateError) Unwrap ¶
func (e CacheUpdateError) Unwrap() error
type Detail ¶
type Detail struct {
Code string `json:"code" yaml:"code"`
Message string `json:"message" yaml:"message"`
Details map[string]any `json:"details,omitempty" yaml:"details,omitempty"`
}
Detail is the structured error body inside an Envelope.
type Envelope ¶
type Envelope struct {
Error Detail `json:"error" yaml:"error"`
}
Envelope is the top-level JSON/YAML payload for structured error responses.
func NewEnvelope ¶
NewEnvelope builds an Envelope from the given code, message, and optional details.
func ParseEnvelope ¶
ParseEnvelope attempts to decode data as a JSON or YAML error envelope. It returns the parsed Envelope and a nil error on success. If data does not contain a valid envelope (or has an empty error code), it returns a non-nil error — callers can use this to distinguish structured errors from plain text.
type ExecutableContextError ¶
type ExecutableContextError struct {
Workspace, Namespace, WorkspacePath, FlowFile string
}
func (ExecutableContextError) Code ¶
func (e ExecutableContextError) Code() string
func (ExecutableContextError) Error ¶
func (e ExecutableContextError) Error() string
type ExecutableNotFoundError ¶
type ExecutableNotFoundError struct {
Ref string
}
func NewExecutableNotFoundError ¶
func NewExecutableNotFoundError(ref string) ExecutableNotFoundError
func (ExecutableNotFoundError) Code ¶
func (e ExecutableNotFoundError) Code() string
func (ExecutableNotFoundError) Error ¶
func (e ExecutableNotFoundError) Error() string
type UsageError ¶
type UsageError struct {
Msg string
}
UsageError indicates the user supplied invalid flags/arguments or attempted an unsupported combination.
func NewUsageError ¶
func NewUsageError(format string, args ...any) UsageError
func (UsageError) Code ¶
func (e UsageError) Code() string
func (UsageError) Error ¶
func (e UsageError) Error() string
type ValidationError ¶
ValidationError indicates a value failed semantic or schema validation.
func NewValidationError ¶
func NewValidationError(msg string, details map[string]any) ValidationError
func (ValidationError) Code ¶
func (e ValidationError) Code() string
func (ValidationError) Error ¶
func (e ValidationError) Error() string
type WorkspaceNotFoundError ¶
type WorkspaceNotFoundError struct {
Workspace string
}
func (WorkspaceNotFoundError) Code ¶
func (e WorkspaceNotFoundError) Code() string
func (WorkspaceNotFoundError) Error ¶
func (e WorkspaceNotFoundError) Error() string