Documentation ¶
Index ¶
- Variables
- type HttpError
- func BadReq(message string, err error, data interface{}) *HttpError
- func BadRequest(message string, err error) *HttpError
- func Dup(message string, err error, data interface{}) *HttpError
- func New(message string) *HttpError
- func NewWithCode(code int, message string) *HttpError
- func Unauth(message string, err error, data interface{}) *HttpError
- func Wrap(message string, err error) *HttpError
- func WrapWithCode(code int, message string, err error) *HttpError
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrDuplicateResource = NewWithCode(http.StatusConflict, "duplicated resource") ErrInvalidRequest = NewWithCode(http.StatusBadRequest, "invalid request ") ErrResourceNotFound = NewWithCode(http.StatusNotFound, "resource not found") ErrAuthorizationRequired = NewWithCode(http.StatusUnauthorized, "authorization required") ErrEndpointNotFound = NewWithCode(http.StatusNotFound, "endpoint not found") ErrFailedRequest = NewWithCode(http.StatusExpectationFailed, "failed request ") )
Functions ¶
This section is empty.
Types ¶
type HttpError ¶
type HttpError struct { Message string `json:"message"` Code int `json:"code"` InnerError error Data interface{} `json:"data"` }
func BadRequest ¶
func NewWithCode ¶
Click to show internal directories.
Click to hide internal directories.