Documentation ¶
Overview ¶
Package errcode redesigned error code
Index ¶
Constants ¶
View Source
const ( CacheTag = "TAG" CacheArticle = "ARTICLE" )
Variables ¶
View Source
var ( Success = NewError(100001, "Success") InternalServerError = NewError(100002, "Internal server error") InvalidParams = NewError(100003, "Invalid parameter") NotFound = NewError(100004, "Not found") DatabaseError = NewError(100101, "Database error") TooManyRequests = NewError(100301, "Too many requests") )
View Source
var ( ErrorGetTagFail = NewError(200100, "Failed to get tag") ErrorGetTagListFail = NewError(200101, "Failed to get tag list") ErrorCreateTagFail = NewError(200102, "Failed to create tag") ErrorUpdateTagFail = NewError(200103, "Failed to update tag") ErrorDeleteTagFail = NewError(200104, "Failed to delete tag") ErrorCountTagFail = NewError(200105, "Failed to count tag") ErrorGetArticleFail = NewError(200201, "Failed to fetch an article") ErrorGetArticlesFail = NewError(200202, "Failed to fetch the articles") ErrorCreateArticleFail = NewError(200203, "Failed to create an article") ErrorUpdateArticleFail = NewError(200204, "Failed to update an article") ErrorDeleteArticleFail = NewError(200205, "Failed to delete an article") ErrorUploadFileFail = NewError(200301, "Failed to upload file") )
Functions ¶
This section is empty.
Types ¶
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
func (*Error) StatusCode ¶
StatusCode converts common error code into http status code
func (*Error) WithDetails ¶
Click to show internal directories.
Click to hide internal directories.