Documentation ¶
Index ¶
- func New(err string) error
- type ErrorResponse
- func BadRequestError(message string) *ErrorResponse
- func ConflictError(message string) *ErrorResponse
- func ForbiddenError(message string) *ErrorResponse
- func InternalServerError() *ErrorResponse
- func NotFoundError(message string) *ErrorResponse
- func RequestTooLargeError(message string) *ErrorResponse
- func UnauthorizedError(message string) *ErrorResponse
- func ValidationError(message string, params map[string][]string) *ErrorResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ErrorResponse ¶
type ErrorResponse struct { Status int `json:"-"` ErrorType string `json:"type"` Message string `json:"message"` Params map[string][]string `json:"params,omitempty"` }
ErrorResponse is the json wrapper for API error responses
func BadRequestError ¶
func BadRequestError(message string) *ErrorResponse
BadRequestError returns a bad request error response
func ConflictError ¶
func ConflictError(message string) *ErrorResponse
ConflictError returns a not found error response
func ForbiddenError ¶
func ForbiddenError(message string) *ErrorResponse
ForbiddenError returns a forbidden error response
func InternalServerError ¶
func InternalServerError() *ErrorResponse
InternalServerError returns an internal server error response
func NotFoundError ¶
func NotFoundError(message string) *ErrorResponse
NotFoundError returns a not found error response
func RequestTooLargeError ¶
func RequestTooLargeError(message string) *ErrorResponse
RequestTooLargeError returns a request too large error response
func UnauthorizedError ¶
func UnauthorizedError(message string) *ErrorResponse
UnauthorizedError returns an unauthorized error response
func ValidationError ¶
func ValidationError(message string, params map[string][]string) *ErrorResponse
ValidationError returns a validation error response
func (*ErrorResponse) Error ¶
func (e *ErrorResponse) Error() string
Click to show internal directories.
Click to hide internal directories.