Documentation
¶
Overview ¶
Package errors provides the standard library's errors package with additional functionality.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func As ¶
As finds the first error in err's chain that matches target, and if so, sets target to that error value and returns true.
func Join ¶
Join returns an error that wraps the given errors. Any nil error values are discarded. Join returns nil if every value in errs is nil. The error formats as the concatenation of the strings obtained by calling the Error method of each element of errs, with a newline between each string. A non-nil error returned by Join implements the Unwrap() []error method.
Types ¶
type Category ¶
type Category uint32
Category represents the category of the error.
const ( // CatUnknown represents an unknown category. This should not be used. CatUnknown Category = Category(pb.ErrorCategory_EC_UNKNOWN) // Unknown // CatRequest represents an error that is caused by the request being incorrect. CatRequest Category = Category(pb.ErrorCategory_EC_REQUEST) // Request // CatSafety represents an error that is caused by a safety issue. CatSafety Category = Category(pb.ErrorCategory_EC_SAFETY) // Safety // CatPermission represents an error that is caused by a permission issue. CatPermission Category = Category(pb.ErrorCategory_EC_PERMISSION) // Permission // CatResourceExhausted represents an error that is caused by a resource being exhausted. CatResourceExhausted Category = Category(pb.ErrorCategory_EC_RESOURCE_EXHAUSTED) // ResourceExhausted // CatInternal represents an error that is caused by an internal issue. CatInternal Category = Category(pb.ErrorCategory_EC_INTERNAL) // Internal )
type Option ¶
type Option func(newOptions) newOptions
Option is a function that modifies the options.
func WithNoSecretDetection ¶
func WithNoSecretDetection() Option
WithNoSecretDetection returns an Option that will prevent secret detection from scrubbing the error message.
type Type ¶
type Type uint16
Type represents the type of the error.
const ( // TypeUnknown represents an unknown type. TypeUnknown Type = Type(pb.ErrorType_ET_UNKNOWN) // Unknown // TypeBadRequest represents a bad request error. TypeBadRequest Type = Type(pb.ErrorType_ET_BAD_REQUEST) // BadRequest // TypeDeadTimer represents that a resource is restricted by a dead timer. Until that // timer expires, the resource cannot be accessed for this use. TypeDeadTimer Type = Type(pb.ErrorType_ET_DEAD_TIMER) // DeadTimer // TypeClusterHealth represents that the cluster is unhealthy and cannot be accessed. TypeClusterHealth Type = Type(pb.ErrorType_ET_CLUSTER_HEALTH) // ClusterHealth // TypePermissionDenied represents that the user does not have permission to access the resource. TypePermissionDenied Type = Type(pb.ErrorType_ET_PERMISSION_DENIED) // PermissionDenied )