Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Success = NewError(0, "成功") ServerError = NewError(10000000, "服务内部错误") InvalidParams = NewError(10000001, "入参错误") NotFound = NewError(10000002, "找不到") TooManyRequests = NewError(10000007, "请求过多") )
View Source
var ( ErrorGetTagListFail = NewError(20010001, "获取标签列表失败") ErrorCreateTagFail = NewError(20010002, "创建标签失败") ErrorUpdateTagFail = NewError(20010003, "更新标签失败") ErrorDeleteTagFail = NewError(20010004, "删除标签失败") ErrorCountTagFail = NewError(20010005, "统计标签失败") ErrorGetArticleFail = NewError(20020001, "获取单个文章失败") ErrorGetArticlesFail = NewError(20020002, "获取多个文章失败") ErrorCreateArticleFail = NewError(20020003, "创建文章失败") ErrorUpdateArticleFail = NewError(20020004, "更新文章失败") ErrorDeleteArticleFail = NewError(20020005, "删除文章失败") ErrorUploadFileFail = NewError(20030001, "上传文件失败") )
View Source
var ( // 10001000 - 10002000: blog error code. ErrTagIDForbidden = NewError(10001000, "`Tag` in used by other article") )
Functions ¶
This section is empty.
Types ¶
type Error ¶
type Error struct { // 错误码 Code int `json:"code"` // 错误消息 Msg string `json:"msg"` // 详细信息 Details []string `json:"details"` }
func (*Error) StatusCode ¶
func (*Error) WithDetails ¶
Click to show internal directories.
Click to hide internal directories.