Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Code ¶
type Code int
Code is a code associated with an error
const ( Internal Code = http.StatusInternalServerError NotFound Code = http.StatusNotFound Forbidden Code = http.StatusForbidden Validation Code = http.StatusBadRequest )
type Error ¶
type Error struct { Code Code `json:"code"` Messages []string `json:"messages,omitempty"` Err string `json:"err,omitempty"` }
Error is a custom error
func Extract ¶
Extract extracts the custom Error from the given error. If the error is nil, nil will be returned
func (*Error) RemoveError ¶
RemoveError removes the error from the Error and leaves it's messages and code
Click to show internal directories.
Click to hide internal directories.