Documentation ¶
Overview ¶
Package httperr provides a http error responses.
Index ¶
- func BadRequest(c *gin.Context, slug string, err error)
- func InternalError(c *gin.Context, slug string, err error)
- func RespondWithSlugError(c *gin.Context, err error)
- func Unauthorised(c *gin.Context, slug string, err error)
- func UnprocessableEntity(c *gin.Context, slug string, err error)
- type ErrorResponse
- type Errors
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BadRequest ¶
BadRequest is a helper function to respond with bad request error.
func InternalError ¶
InternalError is a helper function to respond with internal server error.
func RespondWithSlugError ¶
RespondWithSlugError is a helper function to respond with slug error.
func Unauthorised ¶
Unauthorised is a helper function to respond with unauthorized error.
Types ¶
type ErrorResponse ¶
type ErrorResponse struct {
Errors Errors `json:"errors"`
}
ErrorResponse is a error response.
Click to show internal directories.
Click to hide internal directories.