flux: github.com/weaveworks/flux/pkg/http/httperror Index | Files

package httperror

import "github.com/weaveworks/flux/pkg/http/httperror"

Index

Package Files

api_error.go

type APIError Uses

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 Uses

func (err *APIError) Error() string

func (*APIError) IsMissing Uses

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 Uses

func (err *APIError) IsUnavailable() bool

Does this error mean the API service is unavailable?

Package httperror imports 2 packages (graph). Updated 2019-09-29. Refresh now. Tools for package owners.