Documentation ¶
Index ¶
- Constants
- func New(msg string, details ...Detail) error
- func NewAborted(msg string, details ...Detail) error
- func NewAlreadyExists(msg string, details ...Detail) error
- func NewCancelled(msg string, details ...Detail) error
- func NewDataCorrupted(msg string, details ...Detail) error
- func NewDeadlineExceeded(msg string, details ...Detail) error
- func NewFailedPrecondition(msg string, details ...Detail) error
- func NewInternal(msg string, details ...Detail) error
- func NewInvalidArgument(msg string, details ...Detail) error
- func NewNotFound(msg string, details ...Detail) error
- func NewNotImplemented(msg string, details ...Detail) error
- func NewOutOfRange(msg string, details ...Detail) error
- func NewPermissionDenied(msg string, details ...Detail) error
- func NewRemoved(msg string, details ...Detail) error
- func NewResourceExhausted(msg string, details ...Detail) error
- func NewUnauthenticated(msg string, details ...Detail) error
- func NewUnavailable(msg string, details ...Detail) error
- func Wrap(err error, msg string, details ...Detail) error
- type Detail
- type Meta
- type Option
Constants ¶
const ( // ErrInvalidArgument - an invalid argument provided. // Error message and error details should provide more information. ErrInvalidArgument predefined = "invalid argument" // ErrFailedPrecondition - request can not be executed in the current system state, // such as deleting a non-empty directory. ErrFailedPrecondition predefined = "precondition failed" // ErrOutOfRange - an invalid range provided. ErrOutOfRange predefined = "out of range" // ErrUnauthenticated - not authenticated request due to missing, invalid or expired credentials. ErrUnauthenticated predefined = "unauthenticated" // ErrPermissionDenied - client does not have sufficient permission. ErrPermissionDenied predefined = "permission denied" // ErrNotFound - a specified resource is not found. ErrNotFound predefined = "not found" // ErrAborted - concurrency conflict, such as read-modify-write conflict. ErrAborted predefined = "aborted" // ErrAlreadyExists - the resource that a client tried to create already exists. ErrAlreadyExists predefined = "already exists" // ErrRemoved - a specified resource is no longer available at the origin server // and that this condition is likely to be permanent. ErrRemoved predefined = "removed" // ErrResourceExhausted - either out of resource quota or reaching rate limiting. // Error message and error details should provide more information. ErrResourceExhausted predefined = "resource exhausted" // ErrDataCorrupted - unrecoverable data loss or data corruption. ErrDataCorrupted predefined = "data corrupted" // ErrInternal - internal server error. Typically, a server bug. ErrInternal predefined = "internal" // ErrNotImplemented - API method is not implemented by the server. ErrNotImplemented predefined = "not implemented" ErrUnavailable predefined = "unavailable" // ErrDeadlineExceeded - request deadline exceeded (i.e. requested deadline is not enough // for the server to process the request). ErrDeadlineExceeded predefined = "deadline exceeded" // ErrCancelled - request cancelled by its creator. ErrCancelled predefined = "cancelled" )
Variables ¶
This section is empty.
Functions ¶
func NewAborted ¶
NewAborted - sugar wrapper for ErrAborted.
func NewAlreadyExists ¶
NewAlreadyExists - sugar wrapper for ErrAlreadyExists.
func NewCancelled ¶
NewCancelled - sugar wrapper for ErrCancelled.
func NewDataCorrupted ¶
NewDataCorrupted - sugar wrapper for ErrDataCorrupted.
func NewDeadlineExceeded ¶
NewDeadlineExceeded - sugar wrapper for ErrDeadlineExceeded.
func NewFailedPrecondition ¶
NewFailedPrecondition - sugar wrapper for ErrFailedPrecondition.
func NewInternal ¶
NewInternal - sugar wrapper for ErrInternal.
func NewInvalidArgument ¶
NewInvalidArgument - sugar wrapper for ErrInvalidArgument.
func NewNotFound ¶
NewNotFound - sugar wrapper for ErrNotFound.
func NewNotImplemented ¶
NewNotImplemented - sugar wrapper for ErrNotImplemented.
func NewOutOfRange ¶
NewOutOfRange - sugar wrapper for ErrOutOfRange.
func NewPermissionDenied ¶
NewPermissionDenied - sugar wrapper for ErrPermissionDenied.
func NewRemoved ¶
NewRemoved - sugar wrapper for ErrRemoved.
func NewResourceExhausted ¶
NewResourceExhausted - sugar wrapper for ErrResourceExhausted.
func NewUnauthenticated ¶
NewUnauthenticated - sugar wrapper for ErrUnauthenticated.
func NewUnavailable ¶
NewUnavailable - sugar wrapper for ErrUnavailable.
Types ¶
type Detail ¶
type Detail struct {
// contains filtered or unexported fields
}
Detail represents a set of optional fields which provide more information about a parent error.
func ExtractDetails ¶
ExtractDetails extracts details from an error, if any. Otherwise, returns nil.
func (*Detail) Description ¶
Description is a Detail description getter.
func (*Detail) Domain ¶
Domain is a Detail domain getter. Domain stands here for a specified sphere of activity or knowledge.
type Option ¶
type Option func(*Detail)
Option is a function type for Detail fields' setters.
func WithCode ¶
WithCode is an option for Detail constructs that sets code and marks the detail as not empty.
func WithDescription ¶
WithDescription is an option for Detail constructs that sets description and marks the detail as not empty.
func WithDomain ¶
WithDomain is an option for Detail constructs that sets an error domain and marks the detail as not empty. Domain stands here for a specified sphere of activity or knowledge.
func WithField ¶
WithField is an option for Detail constructs that sets field name and marks the detail as not empty.
func WithMeta ¶ added in v1.1.0
WithMeta is an option for Detail constructs that sets an error arbitrary data and marks the detail as not empty.
func WithReason ¶
WithReason is an option for Detail constructs that sets an error reason and marks the detail as not empty.