Documentation ¶
Index ¶
- func NewBadRequestError(err error) error
- func NewConflictRequestError(err error) error
- func NewErrorWithStatusCode(err error, status int) error
- func NewRequestInternalServerError(err error) error
- func NewRequestMethodNotAllowed(err error) error
- func NewRequestNotFound(err error) error
- func NewRequestNotImplemented(err error) error
- type APIError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBadRequestError ¶
NewBadRequestError creates an apiError with status code 400.
func NewConflictRequestError ¶
NewConflictRequestError creates an apiError with status code 409.
func NewErrorWithStatusCode ¶
NewErrorWithStatusCode creates a new apiError with a given status code
func NewRequestInternalServerError ¶
NewRequestInternalServerError creates an apiError with status code 500.
func NewRequestMethodNotAllowed ¶
NewRequestMethodNotAllowed creates an apiError with status code 405.
func NewRequestNotFound ¶
NewRequestNotFound creates an apiError with status code 404.
func NewRequestNotImplemented ¶
NewRequestNotImplemented creates an apiError with status code 501.
Types ¶
type APIError ¶
type APIError struct {
// contains filtered or unexported fields
}
APIError holds information about an error including status codes.
func (APIError) GetHTTPErrorStatusCode ¶
GetHTTPErrorStatusCode returns the status code.
Click to show internal directories.
Click to hide internal directories.