httperror

package
v1.25.4 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	StatusCode int
	Status     string
	Body       string
}

When an API call fails, we may want to distinguish among the causes by status code. This type can be used as the base error when we get a non-"HTTP 20x" response, retrievable with errors.Cause(err).

func (*APIError) Error

func (err *APIError) Error() string

func (*APIError) IsMissing

func (err *APIError) IsMissing() bool

Is this API call missing? This usually indicates that there is a version mismatch between the client and the service.

func (*APIError) IsUnavailable

func (err *APIError) IsUnavailable() bool

Does this error mean the API service is unavailable?

Jump to

Keyboard shortcuts

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