errorhandler

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Success                = DefaultErrHandler.LNewErrorDesc(error.Success, "OK")
	ServiceNotfound        = DefaultErrHandler.LNewErrorDesc(error.ServiceNotFound, "service no register")
	ErrMessageDecoding     = DefaultErrHandler.LNewErrorDesc(error.MessageDecodingFailed, "RpcMessage decoding invalid")
	ErrMessageEncoding     = DefaultErrHandler.LNewErrorDesc(error.MessageEncodingFailed, "RpcMessage encoding invalid")
	ErrServer              = DefaultErrHandler.LNewErrorDesc(error.ServerError, "server error")
	ErrCallArgsType        = DefaultErrHandler.LNewErrorDesc(error.CallArgsTypeErr, "call arguments type error")
	ErrCodecMarshalError   = DefaultErrHandler.LNewErrorDesc(error.CodecMarshalErr, "codec.Marshal return one error")
	ErrCodecUnMarshalError = DefaultErrHandler.LNewErrorDesc(error.CodecMarshalErr, "codec.UnMarshal return one error")
	ErrClient              = DefaultErrHandler.LNewErrorDesc(error.ClientError, "client error")
	ErrConnection          = DefaultErrHandler.LNewErrorDesc(error.ConnectionErr, "connection error")
	ContextNotFound        = DefaultErrHandler.LNewErrorDesc(error.ContextNotFound, "context not found")
)
View Source
var DefaultErrHandler = New()

DefaultErrHandler 不带栈追踪的默认错误处理器

Functions

func New

func New() perror.LErrors

func NewStackTrace

func NewStackTrace() perror.LErrors

Types

type JsonErrorHandler

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

func (JsonErrorHandler) LNewErrorDesc

func (j JsonErrorHandler) LNewErrorDesc(code int, message string, mores ...interface{}) perror.LErrorDesc

func (JsonErrorHandler) LWarpErrorDesc

func (j JsonErrorHandler) LWarpErrorDesc(desc perror.LErrorDesc, mores ...interface{}) perror.LErrorDesc

Jump to

Keyboard shortcuts

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