errors

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BadRequest   = http.StatusBadRequest
	Unauthorized = http.StatusUnauthorized
	NotFound     = http.StatusNotFound
	Internal     = http.StatusInternalServerError
)
View Source
const (
	UserKind = iota + 1
	InternalKind
	SystemKind
)

Variables

View Source
var (
	ErrInvalidPassword = errors.New("invalid password")
)

Functions

func Catch

func Catch(ctx context.Context, err error) error

func WrapCtx

func WrapCtx(ctx context.Context, err error) error

Types

type CustomError

type CustomError struct {
	Err  error
	Kind int
	Code int
}

func New

func New(err error, kind int, code int) *CustomError

func (*CustomError) Error

func (c *CustomError) Error() string

func (*CustomError) Unwrap

func (c *CustomError) Unwrap() error

Jump to

Keyboard shortcuts

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