Documentation
¶
Overview ¶
Package exitcode defines the shared exit code constants and error type used by all SpecScore CLI commands and library consumers.
Index ¶
- Constants
- type Error
- func ConflictError(msg string) *Error
- func ConflictErrorf(format string, args ...any) *Error
- func InvalidArgsError(msg string) *Error
- func InvalidArgsErrorf(format string, args ...any) *Error
- func InvalidStateError(msg string) *Error
- func InvalidStateErrorf(format string, args ...any) *Error
- func New(code int, msg string) *Error
- func Newf(code int, format string, args ...any) *Error
- func NotFoundError(msg string) *Error
- func NotFoundErrorf(format string, args ...any) *Error
- func UnexpectedError(msg string) *Error
- func UnexpectedErrorf(format string, args ...any) *Error
- func UnsupportedCommandError(msg string) *Error
Constants ¶
const ( Success = 0 // Operation completed successfully. Conflict = 1 // Concurrent-modification conflict. InvalidArgs = 2 // Missing or invalid command arguments/flags. NotFound = 3 // Requested resource does not exist. InvalidState = 4 // State transition is not allowed. AmbiguousSlug = 5 // Slug auto-resolution found multiple candidates. TargetNotSpecScore = 6 // Target directory is not a SpecScore-managed repo. DirtyTree = 7 // Working tree has uncommitted changes in paths to be modified. UnsupportedCommand = 8 // Subcommand not recognized — typically an outdated specscore that predates a required subcommand. Distinct from the shell's 127 (binary absent). Unexpected = 10 // Catch-all for unexpected runtime errors. )
Standard exit codes shared by every CLI command.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error carries a machine-readable exit code alongside a human-readable message. It satisfies both the error interface and the ExitCode() convention checked by the top-level CLI runner.
func ConflictError ¶
ConflictError returns an exit-code-1 error.
func ConflictErrorf ¶
ConflictErrorf returns an exit-code-1 error with a formatted message.
func InvalidArgsError ¶
InvalidArgsError returns an exit-code-2 error.
func InvalidArgsErrorf ¶
InvalidArgsErrorf returns an exit-code-2 error with a formatted message.
func InvalidStateError ¶
InvalidStateError returns an exit-code-4 error.
func InvalidStateErrorf ¶
InvalidStateErrorf returns an exit-code-4 error with a formatted message.
func NotFoundError ¶
NotFoundError returns an exit-code-3 error.
func NotFoundErrorf ¶
NotFoundErrorf returns an exit-code-3 error with a formatted message.
func UnexpectedError ¶
UnexpectedError returns an exit-code-10 error.
func UnexpectedErrorf ¶
UnexpectedErrorf returns an exit-code-10 error with a formatted message.
func UnsupportedCommandError ¶ added in v0.6.0
UnsupportedCommandError returns an exit-code-8 error.