Documentation
¶
Index ¶
- func ErrFromResponse(res *http.Response) error
- func IsDefaultErrorResponse(res *http.Response) (*commonsv2.Error, bool)
- func IsValidationErrorResponse(res *http.Response) (*commonsv2.ValidationErrors, bool)
- type ErrBadRequest
- type ErrDefault
- type ErrNotFound
- type ErrPermissionDenied
- type ErrUnexpectedResponse
- type ErrValidation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrFromResponse ¶ added in v0.1.4
ErrFromResponse maps an HTTP response (with an error status code) to a (more or less) specific error type.
func IsDefaultErrorResponse ¶ added in v0.2.84
func IsValidationErrorResponse ¶ added in v0.2.37
func IsValidationErrorResponse(res *http.Response) (*commonsv2.ValidationErrors, bool)
Types ¶
type ErrBadRequest ¶ added in v0.2.37
ErrBadRequest represents the error of an invalid request to the server.
func (*ErrBadRequest) Error ¶ added in v0.2.37
func (e *ErrBadRequest) Error() string
type ErrDefault ¶ added in v0.2.84
ErrDefault represents the default fallback error used in the mittwald api.
func (*ErrDefault) Error ¶ added in v0.2.84
func (e *ErrDefault) Error() string
type ErrNotFound ¶ added in v0.1.4
ErrNotFound represents the error of trying to access a resource that does not exist.
func (*ErrNotFound) Error ¶ added in v0.1.4
func (e *ErrNotFound) Error() string
type ErrPermissionDenied ¶ added in v0.1.4
ErrPermissionDenied represents the error of trying to access a resource that the currently authenticated user is not authorized to access.
func (*ErrPermissionDenied) Error ¶ added in v0.1.4
func (e *ErrPermissionDenied) Error() string
type ErrUnexpectedResponse ¶
ErrUnexpectedResponse represents the situation in which an unexpected HTTP status code was returned from an API call.
func (*ErrUnexpectedResponse) Error ¶
func (e *ErrUnexpectedResponse) Error() string
type ErrValidation ¶ added in v0.2.37
type ErrValidation struct {
Response *http.Response
ValidationError *commonsv2.ValidationErrors
}
ErrValidation represents a validation error response from the server.
func (*ErrValidation) Error ¶ added in v0.2.37
func (e *ErrValidation) Error() string