errors

package
v1.10.5 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterErrCode added in v1.0.9

func RegisterErrCode(code ErrCode, msg string)

Types

type DefaultErrRep

type DefaultErrRep interface {
	ErrRep() *ErrRep
}

type ErrCode

type ErrCode uint32

func (ErrCode) ErrRep

func (x ErrCode) ErrRep() *ErrRep

func (ErrCode) Error

func (x ErrCode) Error() string

func (ErrCode) GrpcStatus added in v1.2.12

func (x ErrCode) GrpcStatus() *status.Status

example 实现

func (ErrCode) Log

func (x ErrCode) Log(err error) *ErrRep

func (ErrCode) MarshalJSON

func (x ErrCode) MarshalJSON() ([]byte, error)

func (ErrCode) Message

func (x ErrCode) Message(msg string) *ErrRep

func (ErrCode) Response

func (x ErrCode) Response(w http.ResponseWriter)

func (ErrCode) String

func (x ErrCode) String() string

func (ErrCode) Warp

func (x ErrCode) Warp(err error) *ErrRep

type ErrRep

type ErrRep struct {
	Code    ErrCode `json:"code"`
	Message string  `json:"message,omitempty"`
}

func NewErrRep

func NewErrRep(code ErrCode, msg string) *ErrRep

func (*ErrRep) AppendErr

func (x *ErrRep) AppendErr(err error) *ErrRep

func (*ErrRep) Error

func (x *ErrRep) Error() string

func (*ErrRep) GrpcStatus added in v1.2.12

func (x *ErrRep) GrpcStatus() *status.Status

func (*ErrRep) MarshalJSON

func (x *ErrRep) MarshalJSON() ([]byte, error)

func (*ErrRep) Response

func (x *ErrRep) Response(w http.ResponseWriter)

func (*ErrRep) Warp

func (x *ErrRep) Warp(err error) *WarpError

type GrpcStatus added in v1.2.12

type GrpcStatus interface {
	GrpcStatus() *status.Status
}

type Is

type Is interface {
	Is(err error) bool
}

type Unwrap

type Unwrap interface {
	Unwrap(err error) error
}

type WarpError

type WarpError struct {
	ErrRep
	// contains filtered or unexported fields
}

func (*WarpError) Error

func (x *WarpError) Error() string

func (*WarpError) Unwrap

func (x *WarpError) Unwrap() error

Directories

Path Synopsis
Package multierr allows combining one or more errors together.
Package multierr allows combining one or more errors together.

Jump to

Keyboard shortcuts

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