errors

package
v1.2.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: 8 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 ServiceError added in v1.2.0

type ServiceError struct {
	Err  error
	Kind int
	Code int
}

func Wrap added in v1.2.0

func Wrap(err error, kind int, code int) *ServiceError

func (*ServiceError) Error added in v1.2.0

func (c *ServiceError) Error() string

func (*ServiceError) Unwrap added in v1.2.0

func (c *ServiceError) Unwrap() error

Jump to

Keyboard shortcuts

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