Documentation ¶
Index ¶
- Variables
- func AddCode(m map[ErrorCode]struct{}) error
- func Code(c *gin.Context, code ErrorCode)
- func Error(c *gin.Context, err error)
- type ErrCode
- func (e *ErrCode) Code() string
- func (e *ErrCode) Error() string
- func (e *ErrCode) MarshalJSON() ([]byte, error)
- func (e *ErrCode) Message() string
- func (e *ErrCode) Result() interface{}
- func (e *ErrCode) StatusCode() int
- func (e *ErrCode) UnmarshalJSON(bytes []byte) error
- func (e *ErrCode) WithCode(code string) ErrorCode
- func (e *ErrCode) WithMessage(msg string) ErrorCode
- func (e *ErrCode) WithResult(result interface{}) ErrorCode
- func (e *ErrCode) WithStatusCode(statusCode int) ErrorCode
- type ErrorCode
- type InnerError
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type ErrCode ¶
type ErrCode struct {
// contains filtered or unexported fields
}
ErrCode 规定组成部分为http状态码+5位错误码
func (*ErrCode) MarshalJSON ¶ added in v1.2.0
func (*ErrCode) StatusCode ¶
func (*ErrCode) UnmarshalJSON ¶ added in v1.2.0
func (*ErrCode) WithMessage ¶
func (*ErrCode) WithResult ¶ added in v1.2.0
func (*ErrCode) WithStatusCode ¶ added in v1.2.0
type ErrorCode ¶
type InnerError ¶ added in v1.2.0
Click to show internal directories.
Click to hide internal directories.