errorx

package
v0.0.0-...-f98aff7 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPaddingSize = errors.New("padding size error please check the secret key or iv")
	ErrDataType    = errors.New("data type error")
)

Functions

func ExitError

func ExitError(err error)

Types

type ErrOptions

type ErrOptions struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
	Data any    `json:"data"`
}

func NewError

func NewError() *ErrOptions

func NewErrorBadRequest

func NewErrorBadRequest(err error) *ErrOptions

func NewErrorStrWithOptions

func NewErrorStrWithOptions(code int, err string) *ErrOptions

func NewErrorUnauthorized

func NewErrorUnauthorized(err error) *ErrOptions

func NewErrorWithOptions

func NewErrorWithOptions(code int, err error) *ErrOptions

func (*ErrOptions) WithCode

func (e *ErrOptions) WithCode(code int) *ErrOptions

func (*ErrOptions) WithData

func (e *ErrOptions) WithData(data any) *ErrOptions

func (*ErrOptions) WithErr

func (e *ErrOptions) WithErr(err string) *ErrOptions

Jump to

Keyboard shortcuts

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