apperr

package
v1.3.29 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2021 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const DefaultErrCode = 1

Variables

This section is empty.

Functions

func GetRuntimeFrames

func GetRuntimeFrames(skip int) *runtime.Frames

func StackTrace

func StackTrace() []*gostackparse.Goroutine

func Throw

func Throw(e *AppErr)

Types

type AppErr

type AppErr struct {
	Err    error                     `json:"err"`
	Code   uint                      `json:"code"`
	Meta   interface{}               `json:"meta"`
	Stack  []*gostackparse.Goroutine `json:"_stacks,omitempty"`
	Frames *runtime.Frames           `json:"_frames,omitempty"`
}

func New

func New(msg string, meta ...interface{}) *AppErr

func (AppErr) Compose added in v1.3.28

func (msg AppErr) Compose(message string, data ...interface{}) *AppErr

func (*AppErr) Error

func (msg *AppErr) Error() string

func (*AppErr) Errors

func (msg *AppErr) Errors() interface{}

func (*AppErr) JSON

func (msg *AppErr) JSON() interface{}

func (AppErr) MarshalJSON

func (msg AppErr) MarshalJSON() ([]byte, error)

func (AppErr) StackTrace

func (msg AppErr) StackTrace() *runtime.Frames

func (AppErr) Throw

func (msg AppErr) Throw(message string, data ...interface{})

func (*AppErr) Trace

func (msg *AppErr) Trace()

Jump to

Keyboard shortcuts

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