errors

package
v0.0.0-...-e84d343 Latest Latest
Warning

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

Go to latest
Published: May 19, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(text string) error

Types

type ErrCode

type ErrCode string
const (
	ErrCodeNotFound ErrCode = "not_found"
	ErrCodeInternal ErrCode = "internal"
	ErrCodeConflict ErrCode = "conflict"
	ErrCodeInvalid  ErrCode = "invalid"
	ErrUnknown      ErrCode = ""
)

type Error

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

func NewConflictError

func NewConflictError(err error, message string) Error

func NewInternalError

func NewInternalError(err error, message string) Error

func NewInvalidError

func NewInvalidError(err error, message string) Error

func NewNotFoundError

func NewNotFoundError(err error, message string) Error

func NewUnknownError

func NewUnknownError(err error, message string) Error

func (*Error) AppendError

func (e *Error) AppendError(err error) *Error

func (*Error) AppendMsg

func (e *Error) AppendMsg(message string) *Error

func (Error) Code

func (e Error) Code() ErrCode

func (Error) Err

func (e Error) Err() error

func (*Error) Error

func (e *Error) Error() string

func (*Error) HttpStatus

func (err *Error) HttpStatus() int

func (Error) Message

func (e Error) Message() string

func (*Error) PrependError

func (e *Error) PrependError(err error) *Error

func (*Error) PrependMsg

func (e *Error) PrependMsg(message string) *Error

func (*Error) SetCode

func (e *Error) SetCode(code ErrCode) *Error

func (*Error) UnwrapErr

func (e *Error) UnwrapErr() []error

func (Error) Valid

func (e Error) Valid() bool

Jump to

Keyboard shortcuts

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