erri

package
v0.0.0-...-a2dbc2d Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2021 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(e error) error

Error returns an error which prefixes function name, similar to the call-stack

func ErrorInfo

func ErrorInfo(e error) string

用于前端API,如果有Info,会根据Info,返回Info,如果没有,返回底层Err. 会返回I18N和Info的两条错误信息。

func ErrorWithLine

func ErrorWithLine(line string, e error) error

Error returns an error which prefixes function name, similar to the call-stack

func ErrorWrap

func ErrorWrap(e error, format string, a ...interface{}) error

ErrorWrap returns an error which combine current function name and the call-stack

func ErrorWrapWithLine

func ErrorWrapWithLine(line string, e error, format string, a ...interface{}) error

ErrorWrap returns an error which combine current function name and the call-stack

func Errorf

func Errorf(format string, a ...interface{}) error

Errorf returns an error which also prefixes the function name and formats the current error

func ErrorfWithLine

func ErrorfWithLine(line string, format string, a ...interface{}) error

Errorf returns an error which also prefixes the function name and formats the current error

func PrimitiveError

func PrimitiveError(e error) error

func WithInfo

func WithInfo(e error, info string) error

如果要放入Info消息,使用这个方法,可以用ErrorInfo提取出错误。用于前端接口返回,支持I18n

func WithInfoWithLine

func WithInfoWithLine(line string, e error, info string) error

如果要放入Info消息,使用这个方法,可以用ErrorInfo提取出错误。用于前端接口返回,支持I18n

Types

This section is empty.

Jump to

Keyboard shortcuts

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