Documentation ¶
Index ¶
Constants ¶
View Source
const ( CodeInternal = iota + 100 CodeNotFound CodeBadRequest CodeConflict )
Variables ¶
View Source
var ( Internal = Error{ Message: "Internal Server Error", Code: CodeInternal, HttpStatus: http.StatusInternalServerError, } NotFound = Error{ Message: "Not found", HttpStatus: CodeNotFound, Code: http.StatusNotFound, } BadRequest = Error{ Message: "Bad request", HttpStatus: CodeBadRequest, Code: http.StatusBadRequest, } Message: "Unauthorized", HttpStatus: http.StatusUnauthorized, Code: CodeUnauthorized, } Conflict = Error{ Message: "Conflict", HttpStatus: http.StatusConflict, Code: CodeConflict, } )
Functions ¶
Types ¶
type Error ¶
type Error struct { Code int `json:"code,omitempty"` Message string `json:"message"` Detail error `json:"-"` HttpStatus int `json:"-"` }
func (Error) WithDetail ¶
func (Error) WithMessage ¶
func (Error) WithStatus ¶
Click to show internal directories.
Click to hide internal directories.