httperr

package
v0.2.187 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 29, 2026 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrFromResponse added in v0.1.4

func ErrFromResponse(res *http.Response) error

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 IsDefaultErrorResponse(res *http.Response) (*commonsv2.Error, bool)

func IsValidationErrorResponse added in v0.2.37

func IsValidationErrorResponse(res *http.Response) (*commonsv2.ValidationErrors, bool)

Types

type ErrBadRequest added in v0.2.37

type ErrBadRequest struct {
	Response *http.Response
}

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

type ErrDefault struct {
	Response     *http.Response
	DefaultError *commonsv2.Error
}

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

type ErrNotFound struct {
	Response *http.Response
}

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

type ErrPermissionDenied struct {
	Response *http.Response
}

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

type ErrUnexpectedResponse struct {
	Response *http.Response
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL