Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInternalServer = errors.New("internal server error") ErrBadRequest = errors.New("bad request") ErrUnableToCreateLink = errors.New("unable to create link") ErrLinkNotFound = errors.New("link not found") ErrURLNotValid = errors.New("url is not valid") )
View Source
var ( Errors = map[error]struct { Code int Message string }{ ErrInternalServer: { http.StatusInternalServerError, ErrInternalServer.Error(), }, ErrBadRequest: { http.StatusBadRequest, ErrBadRequest.Error(), }, ErrUnableToCreateLink: { http.StatusConflict, ErrUnableToCreateLink.Error(), }, ErrLinkNotFound: { http.StatusNotFound, ErrLinkNotFound.Error(), }, ErrURLNotValid: { http.StatusBadRequest, ErrURLNotValid.Error(), }, } )
Functions ¶
This section is empty.
Types ¶
type APIError ¶
type APIError struct {
// contains filtered or unexported fields
}
func BadRequestError ¶
func BadRequestError() *APIError
func InternalError ¶
func NewAPIError ¶
func NotFoundError ¶
func NotFoundError() *APIError
Click to show internal directories.
Click to hide internal directories.