apperror

package
v0.0.0-...-cad48ee Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CodeInvalid      = Code("invalid")
	CodeUnauthorized = Code("unauthorized")
	CodeNotFound     = Code("not found")
	CodeError        = Code("error")
)

Variables

View Source
var (
	ErrDuplicated = errors.New("duplicated key exists")
)

Functions

func New

func New(code Code, msg string) error

func NewAWS

func NewAWS(err aws.Error) error

func NewGormCreate

func NewGormCreate(err error, model string) error

func NewGormDelete

func NewGormDelete(err error, model string) error

func NewGormFind

func NewGormFind(err error, model string) error

func NewGormSave

func NewGormSave(err error, model string) error

func NewGormUpdate

func NewGormUpdate(err error, model string) error

func Newf

func Newf(code Code, msg string, args ...interface{}) error

func WithCode

func WithCode(code Code, err error) error

func Wrap

func Wrap(err error, msg string) error

func Wrapf

func Wrapf(err error, msg string, args ...interface{}) error

Types

type Code

type Code string

func (Code) String

func (c Code) String() string

type Error

type Error struct {
	// contains filtered or unexported fields
}

func Unwrap

func Unwrap(err error) *Error

func (*Error) Code

func (e *Error) Code() Code

func (*Error) Error

func (e *Error) Error() string

func (*Error) Origin

func (e *Error) Origin() error

Jump to

Keyboard shortcuts

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