Documentation
¶
Index ¶
- Variables
- func ErrorMessage(err error) (code int, message map[string]interface{})
- func NewWithDesc(e error, desc string) error
- func NewWithExtras(e error, desc string, extra map[string]interface{}) error
- type HTTPError
- func (e *HTTPError) AddDesc(desc string) *HTTPError
- func (e *HTTPError) AddErr(err error) *HTTPError
- func (e *HTTPError) Code() int
- func (e *HTTPError) Data() interface{}
- func (e *HTTPError) Desc() string
- func (e *HTTPError) Error() string
- func (e *HTTPError) Extra() map[string]interface{}
- func (e *HTTPError) Message() string
- func (e *HTTPError) SetData(data interface{}) *HTTPError
- type IHTTPError
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInternalError = NewHTTPError(500, "Internal Error") ErrInvalidParam = NewHTTPError(400, "Bad Request") ErrUnauthorized = NewHTTPError(401, "Unauthorized") // ErrForbidden ... ErrForbidden = NewHTTPError(403, "Forbidden") // ErrNotFound ... ErrNotFound = NewHTTPError(404, "Request Not Found") InvalidDataInRequest = "invalid data json in request" // ResponseError export common response error, can use addErr to add error replace default error RespnseError = NewHTTPError(4000, "Response Error") )
Functions ¶
func ErrorMessage ¶
ErrorMessage returns the code and message for Gins JSON helpers
Types ¶
type HTTPError ¶
type HTTPError struct {
// contains filtered or unexported fields
}
HTTPError ...
func NewHTTPError ¶
NewHTTPError ...
Click to show internal directories.
Click to hide internal directories.