Documentation
¶
Overview ¶
Package errs exposes a common set of error types. It is designed so these errors can be declared as constants.
Index ¶
Examples ¶
Constants ¶
View Source
const ( Unauthenticated = UnauthenticatedError("unauthenticated") InvalidArgument = InvalidArgumentError("invalid argument") NotFound = NotFoundError("not found") Conflict = ConflictError("conflict") PermissionDenied = PermissionDeniedError("permission denied") Gone = GoneError("gone") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConflictError ¶
type ConflictError string
func (ConflictError) Error ¶
func (e ConflictError) Error() string
func (ConflictError) Is ¶
func (e ConflictError) Is(target error) bool
func (ConflictError) Kind ¶ added in v0.3.0
func (e ConflictError) Kind() Kind
type Error ¶ added in v0.3.0
Error interface represents an error that was built using this very package. Meaning it exposes a Kind() method.
Example ¶
const err = UnauthenticatedError("an unauthenticated error") fmt.Println(err.Kind() == KindUnauthenticated)
Output: true
type InvalidArgumentError ¶
type InvalidArgumentError string
func (InvalidArgumentError) Error ¶
func (e InvalidArgumentError) Error() string
func (InvalidArgumentError) Is ¶
func (e InvalidArgumentError) Is(target error) bool
func (InvalidArgumentError) Kind ¶ added in v0.3.0
func (e InvalidArgumentError) Kind() Kind
type NotFoundError ¶
type NotFoundError string
func (NotFoundError) Error ¶
func (e NotFoundError) Error() string
func (NotFoundError) Is ¶
func (e NotFoundError) Is(target error) bool
func (NotFoundError) Kind ¶ added in v0.3.0
func (e NotFoundError) Kind() Kind
type PermissionDeniedError ¶
type PermissionDeniedError string
func (PermissionDeniedError) Error ¶
func (e PermissionDeniedError) Error() string
func (PermissionDeniedError) Is ¶
func (e PermissionDeniedError) Is(target error) bool
func (PermissionDeniedError) Kind ¶ added in v0.3.0
func (e PermissionDeniedError) Kind() Kind
type UnauthenticatedError ¶
type UnauthenticatedError string
func (UnauthenticatedError) Error ¶
func (e UnauthenticatedError) Error() string
func (UnauthenticatedError) Is ¶
func (e UnauthenticatedError) Is(target error) bool
func (UnauthenticatedError) Kind ¶ added in v0.3.0
func (e UnauthenticatedError) Kind() Kind
Click to show internal directories.
Click to hide internal directories.