apperr

package
v0.0.0-...-d2182b9 Latest Latest
Warning

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

Go to latest
Published: May 12, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppErr

type AppErr struct {
	HTTPCode int         `json:"http_code" bson:"http_code"`
	Err      error       `json:"err" bson:"err"`
	Key      string      `json:"key" bson:"key"`
	Message  string      `json:"message" bson:"message"`
	Data     interface{} `json:"data" bson:"data"`
}

func GetFromString

func GetFromString(str string) *AppErr

func New

func New(httpCode int, err error, msg, key string) *AppErr

func NewErr

func NewErr(opt Options) *AppErr

func (AppErr) Error

func (appErr AppErr) Error() string

type Options

type Options struct {
	HTTPCode int
	Err      error
	Key      string
	Message  string
	Data     interface{}
	NotPrint bool
}

Jump to

Keyboard shortcuts

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