Documentation
¶
Index ¶
Constants ¶
View Source
const ( Success = 0 General = 1 Usage = 2 Authentication = 3 NotFound = 4 PermissionDenied = 5 RateLimited = 6 PartialFailure = 7 )
Exit codes matching README documentation.
Variables ¶
This section is empty.
Functions ¶
func CodeFrom ¶
CodeFrom extracts the exit code from an error. If the error contains an *Error anywhere in its chain, that code is returned. Otherwise returns General (1).
func PartialOrPropagate ¶ added in v1.19.0
PartialOrPropagate maps a batch tally to an exit error:
- failed == 0 -> nil
- succeeded > 0 && failed > 0 -> PartialFailure (7) carrying msg + counts
- succeeded == 0 && failed > 0-> firstErr's exit code (propagated), or General
Types ¶
type Error ¶
type Error struct {
Code int
Message string
Err error // optional wrapped error
Hint string // optional one-line remediation, surfaced separately
Details map[string]any // optional structured extras for the JSON envelope
}
Error is an error that carries a specific exit code.
func (*Error) WithDetails ¶ added in v1.19.0
WithDetails attaches structured extras and returns e for chaining.
Click to show internal directories.
Click to hide internal directories.