apperr

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: MIT Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package apperr defines the stable, machine-readable errors exposed by the CLI.

Index

Constants

View Source
const (
	Invalid           = "INVALID_ARGUMENT"
	NotFound          = "NOT_FOUND"
	Conflict          = "CONFLICT"
	InvalidTransition = "INVALID_TRANSITION"
	Cycle             = "DEPENDENCY_CYCLE"
	NoProject         = "NO_PROJECT"
	Ambiguous         = "AMBIGUOUS_IDENTITY"
	ConfigInvalid     = "CONFIG_INVALID"
	SchemaTooNew      = "SCHEMA_TOO_NEW"
	Busy              = "DB_BUSY"
	RequestIDReused   = "REQUEST_ID_REUSED"
	Usage             = "USAGE"
	CheckFailed       = "CHECK_FAILED"
	Internal          = "INTERNAL"
	NoRun             = "NO_RUN"
	Unavailable       = "UNAVAILABLE" // a required external tool (tmux, git, harness) failed
	Forbidden         = "FORBIDDEN"   // a child acting for another run, or without its run token
	NotImplemented    = "NOT_IMPLEMENTED"
)

Stable error codes. Never rename; only add.

Variables

This section is empty.

Functions

func Code

func Code(err error) string

Code returns the code of err, or Internal for foreign errors.

Types

type Error

type Error struct {
	Code      string
	Message   string
	Retryable bool
}

Error is an error with a stable code.

func As

func As(err error) (*Error, bool)

As extracts an *Error from err, if any.

func New

func New(code, format string, args ...any) *Error

New returns a non-retryable error with the given code.

func Retryable

func Retryable(code, format string, args ...any) *Error

Retryable returns a retryable error with the given code.

func (*Error) Error

func (e *Error) Error() string

Jump to

Keyboard shortcuts

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