fail

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package fail holds the error type every siding command fails with: a stable code that agents may branch on, a message, and an optional hint on what to do next. Codes are part of the --json contract and are never renamed within an apiVersion.

Index

Constants

View Source
const (
	// InvalidArguments: unknown command, flag or argument.
	InvalidArguments = "InvalidArguments"
	// NotAGitRepository: the current directory is not inside a git worktree.
	NotAGitRepository = "NotAGitRepository"
	// NoBranch: the worktree's HEAD is detached.
	NoBranch = "NoBranch"
	// ComposeFileNotFound: the worktree has no compose file.
	ComposeFileNotFound = "ComposeFileNotFound"
	// ComposeFailed: docker compose failed, or is missing or too old.
	ComposeFailed = "ComposeFailed"
	// DockerUnavailable: the Docker daemon cannot be reached.
	DockerUnavailable = "DockerUnavailable"
	// ProxyNotRunning: siding-proxy is not running.
	ProxyNotRunning = "ProxyNotRunning"
	// PortInUse: the proxy's port is held by another process.
	PortInUse = "PortInUse"
	// InvalidRoute: a dev.siding.route or dev.siding.port label cannot be used.
	InvalidRoute = "InvalidRoute"
	// AmbiguousPort: a routed service has several container ports and no dev.siding.port.
	AmbiguousPort = "AmbiguousPort"
	// SlugCollision: another branch or worktree already owns the Compose project.
	SlugCollision = "SlugCollision"
	// StackNotFound: the worktree has no stack.
	StackNotFound = "StackNotFound"
	// UnmergedBranch: removing data refused because the branch is not merged.
	UnmergedBranch = "UnmergedBranch"
	// DirtyWorktree: removing data refused because the worktree has changes.
	DirtyWorktree = "DirtyWorktree"
	// NoCapacity: the stack does not fit into the memory budget. The only code that exits 3.
	NoCapacity = "NoCapacity"
	// NotInteractive: a command would ask a question, but nobody can answer it.
	NotInteractive = "NotInteractive"
	// SnapshotNotFound: the repository has no snapshot of that name.
	SnapshotNotFound = "SnapshotNotFound"
	// SnapshotExists: the repository already has a snapshot of that name.
	SnapshotExists = "SnapshotExists"
	// EnvFileMissing: a linked worktree lacks an untracked env file the main worktree has.
	EnvFileMissing = "EnvFileMissing"
	// Internal: an unexpected error without a code of its own.
	Internal = "Internal"
)

Error codes. The spec cli-contract lists them; add new ones there too.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	Code    string
	Message string
	Hint    string
}

Error is a failure with a stable code.

func New

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

New returns an Error with a formatted message.

func (*Error) Error

func (e *Error) Error() string

func (*Error) WithHint

func (e *Error) WithHint(format string, args ...any) *Error

WithHint returns e with its hint set.

Jump to

Keyboard shortcuts

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