Documentation
¶
Overview ¶
Package errcode is the one table of TSLink's stable error codes: for each code, the process exit code it produces, whether a daemon failure with it isolates one service, and what it means. output.ExitCode, the daemon's per-service isolation and the manifest's error_codes are all derived from this table, and a test scans the product source so an emitted code the table does not list fails the tests.
The Go constants that name the codes stay beside the code that raises them (registry.CodeX, config.CodeX); the table is keyed by the wire string, which never changes once released.
Index ¶
Constants ¶
const ( ExitSuccess = 0 ExitError = 1 ExitUsage = 2 ExitAuth = 3 ExitConflict = 4 ExitNotFound = 5 ExitWarning = 64 ExitCritical = 65 )
Exit codes. internal/output re-exports them.
const ( InternalError = "internal_error" UsageError = "usage_error" AuthError = "auth_error" Conflict = "conflict" NotFound = "not_found" )
Generic codes name an exit class and nothing more: output.StableErrorCode gives them to an error that carries only an exit code.
Variables ¶
This section is empty.
Functions ¶
func ExitFor ¶
ExitFor returns the exit code a failure with this stable code produces. A code the table does not list exits ExitError; the source scan test keeps that case out of the product.
func IsServiceScoped ¶
IsServiceScoped reports whether a daemon failure with this code isolates the one service it belongs to instead of failing the sync.
Types ¶
type Scope ¶
type Scope int
Scope says what a failure with a code stops when the daemon meets it.
const ( // Command codes fail the command that raised them. In the daemon they are // not a verdict about one service, so a sync that meets one fails. Command Scope = iota // Service codes describe one service's configuration or start. The daemon // isolates that service, records the failure with its next steps for // status and doctor, and keeps serving the others. Service )