Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrValidation = NewBadRequestError(New("validation failed")) ErrBadRequest = NewBadRequestError(New("bad request")) ErrNotFound = NewNotFoundError(New("not found")) ErrInternal = NewStatusInternalServerError(New("internal error")) )
Service errors.
Functions ¶
func StatusCodeFromError ¶
StatusCodeFromError returns status code if an error implements an interface.
Types ¶
type StatusErr ¶
type StatusErr struct {
// contains filtered or unexported fields
}
StatusErr an error with status code.
func NewBadRequestError ¶
NewBadRequestError represents BadRequest error.
func NewNotFoundError ¶
NewNotFoundError represents NotFound error.
func NewStatusInternalServerError ¶
NewStatusInternalServerError represents InternalServerError.
func (*StatusErr) StatusCode ¶
StatusCode returns HTTP status code.
Click to show internal directories.
Click to hide internal directories.