Documentation
¶
Index ¶
- Variables
- func ConcatError(errs []error) error
- func ErrorStatus(err error) (status int, message string)
- func HandleError(w http.ResponseWriter, err error) bool
- func WrapInternal(err error) error
- func WrapInvalid(err error) error
- func WrapMethodNotAllowed(err error) error
- func WrapNotFound(err error) error
- type Message
- type TemplateFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalid occurs when checks fails ErrInvalid = errors.New("invalid") // ErrNotFound occurs when something is not found ErrNotFound = errors.New("not found") // ErrMethodNotAllowed occurs when method is not allowed ErrMethodNotAllowed = errors.New("method not allowed") // ErrInternalError occurs when shit happens ErrInternalError = errors.New("internal error") )
Functions ¶
func ConcatError ¶
ConcatError concat errors to a single string
func ErrorStatus ¶ added in v3.34.1
ErrorStatus guess HTTP status and message from given error
func HandleError ¶ added in v3.36.0
func HandleError(w http.ResponseWriter, err error) bool
HandleError return a status code according to given error
func WrapInternal ¶
WrapInternal wraps given error with internal err
func WrapMethodNotAllowed ¶
WrapMethodNotAllowed wraps given error with not method not allowed err
func WrapNotFound ¶
WrapNotFound wraps given error with not found err
Types ¶
type Message ¶
Message for render
func NewErrorMessage ¶
NewErrorMessage create a error message
func NewSuccessMessage ¶
NewSuccessMessage create a success message
func ParseMessage ¶
ParseMessage parses messages from request
Click to show internal directories.
Click to hide internal directories.