Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Aggregate ¶
Aggregate wraps one or more errors with a stable kind and operation. nil errors are ignored. Returns nil when errs has no non-nil entries.
Types ¶
type E ¶
type E struct {
Op string // where it happened, e.g. "dockercli.SyncVolume"
Kind Kind // category
Err error // wrapped cause
Msg string // optional, short context message
}
E is a rich, chainable error.
type Kind ¶
type Kind string
Kind is a stable category for application errors.
const ( // Stable kinds you can switch/branch on across packages. InvalidInput Kind = "invalid_input" NotFound Kind = "not_found" Conflict Kind = "conflict" Forbidden Kind = "forbidden" Precondition Kind = "precondition_failed" Timeout Kind = "timeout" External Kind = "external" // external tool failed (docker/sops) Internal Kind = "internal" // programmer bug, invariant broken )
type MultiError ¶
type MultiError struct {
Errors []error
}
MultiError groups multiple errors and supports errors.Is/errors.As traversal.
func (*MultiError) Error ¶
func (m *MultiError) Error() string
func (*MultiError) Unwrap ¶
func (m *MultiError) Unwrap() []error
Unwrap exposes all inner errors for errors.Is/errors.As in Go 1.20+.
Click to show internal directories.
Click to hide internal directories.