errutils

package
v4.12.3 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPDoError

type HTTPDoError struct {
	// contains filtered or unexported fields
}

HTTPDoError uses with `(http.Client).Do` error.

func NewHTTPDoError

func NewHTTPDoError(req *http.Request, err error) *HTTPDoError

NewHTTPDoError creates a new HTTPDoError.

func (HTTPDoError) Error

func (h HTTPDoError) Error() string

func (HTTPDoError) Unwrap

func (h HTTPDoError) Unwrap() error

type ReadResponseError

type ReadResponseError struct {
	StatusCode int
	// contains filtered or unexported fields
}

ReadResponseError use with `io.ReadAll` when reading response body.

func NewReadResponseError

func NewReadResponseError(req *http.Request, statusCode int, err error) *ReadResponseError

NewReadResponseError creates a new ReadResponseError.

func (ReadResponseError) Error

func (r ReadResponseError) Error() string

func (ReadResponseError) Unwrap

func (r ReadResponseError) Unwrap() error

type UnexpectedStatusCodeError

type UnexpectedStatusCodeError struct {
	StatusCode int
	Body       []byte
	// contains filtered or unexported fields
}

UnexpectedStatusCodeError use when the status of the response is unexpected but there is no API error type.

func NewUnexpectedResponseStatusCodeError

func NewUnexpectedResponseStatusCodeError(req *http.Request, resp *http.Response) *UnexpectedStatusCodeError

func NewUnexpectedStatusCodeError

func NewUnexpectedStatusCodeError(req *http.Request, statusCode int, body []byte) *UnexpectedStatusCodeError

NewUnexpectedStatusCodeError creates a new UnexpectedStatusCodeError.

func (UnexpectedStatusCodeError) Error

type UnmarshalError

type UnmarshalError struct {
	StatusCode int
	Body       []byte
	// contains filtered or unexported fields
}

UnmarshalError uses with `json.Unmarshal` or `xml.Unmarshal` when reading response body.

func NewUnmarshalError

func NewUnmarshalError(req *http.Request, statusCode int, body []byte, err error) *UnmarshalError

NewUnmarshalError creates a new UnmarshalError.

func (UnmarshalError) Error

func (u UnmarshalError) Error() string

func (UnmarshalError) Unwrap

func (u UnmarshalError) Unwrap() error

Jump to

Keyboard shortcuts

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