Documentation ¶
Overview ¶
Package errors holds the HTTP errors that the API returns.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrAlreadyExists = New( http.StatusConflict, "AlreadyExists", "entry already exists") ErrInternal = New( http.StatusInternalServerError, "Internal", http.StatusText(http.StatusInternalServerError)) http.StatusUnauthorized, "Unauthorized", http.StatusText(http.StatusUnauthorized)) ErrForbiden = New( http.StatusForbidden, "Forbiden", http.StatusText(http.StatusForbidden)) ErrNotFound = New( http.StatusNotFound, "NotFound", http.StatusText(http.StatusNotFound)) ErrBadRequest = New( http.StatusBadRequest, "BadRequest", http.StatusText(http.StatusBadRequest)) ErrUnprocessable = New( http.StatusUnprocessableEntity, "UnprocessableEntity", http.StatusText(http.StatusUnprocessableEntity)) ErrUnsupportedMediaType = New( http.StatusUnsupportedMediaType, "UnsupportedMediaType", http.StatusText(http.StatusUnsupportedMediaType)) )
Functions ¶
This section is empty.
Types ¶
type Error ¶
type Error struct { Status int `json:"status,omitempty"` Type string `json:"type"` Message string `json:"message"` }
Error holds the basic error struct.
type MultiError ¶
type MultiError struct { Status int `json:"status,omitempty"` Type string `json:"type"` Message string `json:"message"` Errors []Error `json:"errors,omitempty"` }
MultiError holds nested errors.
func NewMultiError ¶
func NewMultiError(s int, t, m string, errs []Error) *MultiError
NewMultiError creates and returns an error with multiple nested errors.
func (*MultiError) Error ¶
func (e *MultiError) Error() string
Error implements the error interface.
Click to show internal directories.
Click to hide internal directories.