pkgerr

package
v0.0.0-...-06621f0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsErrAlreadyExists

func IsErrAlreadyExists(err error) bool

func IsErrBadRequest

func IsErrBadRequest(err error) bool

func IsErrConflict

func IsErrConflict(err error) bool

func IsErrNotFound

func IsErrNotFound(err error) bool

func IsErrPermissionDenied

func IsErrPermissionDenied(err error) bool

func IsErrUnauthenticated

func IsErrUnauthenticated(err error) bool

Types

type Code

type Code int
const (
	CodeUnspecified Code = iota
	CodeBadRequest
	CodeNotFound
	CodeAlreadyExists
	CodeConflict
	CodeUnauthenticated
	CodePermissionDenied
)

func (Code) ToHTTPStatusCode

func (c Code) ToHTTPStatusCode() int

type Known

type Known struct {
	Code      Code
	Origin    error
	ClientMsg string
}

func AsKnown

func AsKnown(err error) (Known, bool)

func (Known) Error

func (k Known) Error() string

func (Known) Unwrap

func (k Known) Unwrap() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL