Documentation ¶
Overview ¶
Package cipderr contains an enumeration with possible CIPD error categories.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AttachDetails ¶
AttachDetails attaches details to an error, preserving its code.
Overrides any previous details. Does nothing if `err` is nil.
Types ¶
type Code ¶
type Code string
Code is returned as part of JSON output by CIPD CLI.
It as an enumeration with broad categories of possible errors.
const ( // Authentication or authorization error when contacting the backend. Auth Code = "auth_error" // An error doing local I/O (i.e. writing or reading files). IO Code = "io_error" // An IO error reading or writing from CIPD CAS. CAS Code = "cas_error" // An incorrectly formatted version name, instance ID, etc. BadArgument Code = "bad_argument_error" // A requested package is missing or its version can't be resolved. InvalidVersion Code = "invalid_version_error" BackendUnavailable Code = "backend_unavailable_error" // A generic fatal RPC error, e.g. violation of some precodition. RPC Code = "rpc_error" // Something (e.g. a resolved pins file) needs to be regenerated. Stale Code = "stale_error" // A hash of downloaded file doesn't match the expected value. HashMismatch Code = "hash_mismatch_error" // The admission plugin forbid installation of a package. NotAdmitted Code = "not_admitted_error" // A timeout of some sort. Timeout Code = "timeout_error" // Unrecognized (possibly transient) error. Unknown Code = "unknown_error" )
func (Code) GenerateErrorTagValue ¶
GenerateErrorTagValue is part of errors.TagValueGenerator, allowing this code to be used as en error tag.
func (Code) WithDetails ¶
func (c Code) WithDetails(d Details) errors.TagValueGenerator
WithDetails returns a error tag that attaches this code together with some details.
Click to show internal directories.
Click to hide internal directories.