Documentation ¶
Index ¶
- Variables
- func BadRequest(ctx iris.Context, msg ...string)
- func BizError(ctx iris.Context, code string, msg ...string)
- func NotFound(ctx iris.Context)
- func Ok(ctx iris.Context, data ...interface{})
- func ServerError(ctx iris.Context, msg ...string)
- func Unauthorized(ctx iris.Context, msg ...string)
- func UnknownError(ctx iris.Context, msg ...string)
- type ErrorCode
- type Ret
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Success = ErrorCode{"0", "success"} NoAuth = ErrorCode{"401", "unauthorized!"} NoFound = ErrorCode{"404", "route not found!"} InternalError = ErrorCode{"500", "internal error"} IllegalParam = ErrorCode{"400", "illegal param"} UnknownErr = ErrorCode{"999", "unknown error"} BizErr = ErrorCode{"1000", "biz error"} )
BizError should be greater than 1000 Since we try to use the http code as much as we can
Functions ¶
func ServerError ¶
func ServerError(ctx iris.Context, msg ...string)
ServerError 不可遇见的服务器错误, 可以使用此方法
func Unauthorized ¶ added in v0.0.3
func Unauthorized(ctx iris.Context, msg ...string)
Unauthorized 未授权
func UnknownError ¶ added in v0.0.3
func UnknownError(ctx iris.Context, msg ...string)
UnknownError error that could not be identified
Types ¶
Click to show internal directories.
Click to hide internal directories.