httperr

package
v0.2.18 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2025 License: MIT Imports: 2 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.

Types

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

Jump to

Keyboard shortcuts

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