Documentation
¶
Overview ¶
Package errs is the public re-export surface for raid's structured errors. The concrete types and constructors live in src/internal/lib/errs; this package aliases them so callers in src/cmd/ and other public packages depend only on this stable surface.
Every code is part of raid's CLI contract: codes never change name or category across minor versions; new codes ship additively. See /docs/references/errors for the full table and the JSON shape.
Index ¶
- Constants
- func EmitJSON(w io.Writer, err error)
- func ExitCode(err error) int
- func IsReservedErrorKey(k string) bool
- type Category
- type Error
- func ArgInvalid(msg string) Error
- func AsError(err error) (Error, bool)
- func CloneFailed(name, url string, cause error) Error
- func CommandNotFound(name string) Error
- func ConfigInvalid(cause error) Error
- func ConfigLoadFailed(cause error) Error
- func EnvNotFound(name string) Error
- func GitNotInstalled() Error
- func HeadlessPromptNoDefault(varName string) Error
- func Internal(msg string) Error
- func LockFailed(cause error) Error
- func Newf(code string, category Category, format string, args ...any) Error
- func ProfileAlreadyExists(name string) Error
- func ProfileFileMissing(path string) Error
- func ProfileFileRead(path string, cause error) Error
- func ProfileInvalid(path string, cause error) Error
- func ProfileNotActive() Error
- func ProfileNotFound(name string) Error
- func RepoInvalid(name string, cause error) Error
- func RepoNotCloned(name, path string) Error
- func RepoNotFound(name string) Error
- func SchemaValidationFailed(path string, cause error) Error
- func TaskFailed(taskType string, cause error) Error
- func TaskGitFailed(cause error) Error
- func TaskHTTPFailed(url string, cause error) Error
- func TaskScriptFailed(cause error) Error
- func TaskShellFailed(cause error) Error
- func TaskTemplateFailed(cause error) Error
- func TaskWaitTimeout(target string, cause error) Error
- func Unknown(cause error) Error
- func VerifyFailed(name string, cause error) Error
- func Wrap(err error) Error
Constants ¶
const ( CategoryGeneric = liberrs.CategoryGeneric CategoryConfig = liberrs.CategoryConfig CategoryTask = liberrs.CategoryTask CategoryNetwork = liberrs.CategoryNetwork CategoryNotFound = liberrs.CategoryNotFound )
Category constants — values match the documented CLI exit codes.
const ( CodeUnknown = liberrs.CodeUnknown CodeInternal = liberrs.CodeInternal CodeGitNotInstalled = liberrs.CodeGitNotInstalled CodeLockFailed = liberrs.CodeLockFailed CodeProfileInvalid = liberrs.CodeProfileInvalid CodeProfileFileRead = liberrs.CodeProfileFileRead CodeProfileAlreadyExists = liberrs.CodeProfileAlreadyExists CodeRepoInvalid = liberrs.CodeRepoInvalid CodeConfigInvalid = liberrs.CodeConfigInvalid CodeConfigLoadFailed = liberrs.CodeConfigLoadFailed CodeSchemaValidationFailed = liberrs.CodeSchemaValidationFailed CodeArgInvalid = liberrs.CodeArgInvalid CodeTaskFailed = liberrs.CodeTaskFailed CodeTaskShellFailed = liberrs.CodeTaskShellFailed CodeTaskScriptFailed = liberrs.CodeTaskScriptFailed CodeTaskWaitTimeout = liberrs.CodeTaskWaitTimeout CodeTaskTemplateFailed = liberrs.CodeTaskTemplateFailed CodeTaskGitFailed = liberrs.CodeTaskGitFailed CodeCloneFailed = liberrs.CodeCloneFailed CodeTaskHTTPFailed = liberrs.CodeTaskHTTPFailed CodeProfileNotFound = liberrs.CodeProfileNotFound CodeProfileNotActive = liberrs.CodeProfileNotActive CodeProfileFileMissing = liberrs.CodeProfileFileMissing CodeRepoNotFound = liberrs.CodeRepoNotFound CodeRepoNotCloned = liberrs.CodeRepoNotCloned CodeEnvNotFound = liberrs.CodeEnvNotFound CodeCommandNotFound = liberrs.CodeCommandNotFound CodeVerifyFailed = liberrs.CodeVerifyFailed CodeHeadlessPromptNoDefault = liberrs.CodeHeadlessPromptNoDefault )
Stable code strings. Documented at /docs/references/errors.
Variables ¶
This section is empty.
Functions ¶
func IsReservedErrorKey ¶ added in v0.17.2
IsReservedErrorKey reports whether k is reserved by the structured error envelope (code/message/category/hint). Peer emitters that flatten Details() into their own JSON shape (e.g. the MCP tool- result builder) should consult this so envelope keys don't get overwritten by accidental Details collisions.
Types ¶
type Error ¶
Error is the structured-error interface every raid failure satisfies.
func ArgInvalid ¶
func CloneFailed ¶
func CommandNotFound ¶
func ConfigInvalid ¶
func ConfigLoadFailed ¶
func EnvNotFound ¶
func GitNotInstalled ¶
func GitNotInstalled() Error
func HeadlessPromptNoDefault ¶
func LockFailed ¶
func Newf ¶
Newf builds a structured error with an arbitrary formatted message. Prefer the dedicated constructors below — this exists for call sites that need to preserve a specific historic wording for back-compat.
func ProfileAlreadyExists ¶
func ProfileFileMissing ¶
func ProfileFileRead ¶
func ProfileInvalid ¶
func ProfileNotActive ¶
func ProfileNotActive() Error