Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BadRequest ¶
func NotFoundErr ¶
NotFoundErr use http.StatusNotFound as StatusCode to express not found err if fmtAndArgs is not nil, update the Message according to fmtAndArgs
Types ¶
type MErr ¶
type MErr struct { Message string // 保存自定义的错误信息 StatusCode int // 错误状态码 // contains filtered or unexported fields }
func WrapErr ¶
WrapErr equal to InternalErr(err) notice: be careful, the returned value is *MErr, not error
func WrapErrWithCode ¶
WrapErrWithCode if code is not 0, update StatusCode to code, if fmtAndArgs is not nil, update the Message according to fmtAndArgs notice: be careful, the returned value is *MErr, not error
Click to show internal directories.
Click to hide internal directories.