errors

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasCode

func HasCode(code int, err error) bool

HasCode returns true if err resembles an HTTP error with status code.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound returns true if err resembles an HTTP NotFound error.

func IsPipelineAlreadyExists

func IsPipelineAlreadyExists(err error) bool

IsPipelineAlreadyExists returns true if the error indicates that a pipeline already exists.

Types

type ResponseError

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

ResponseError wraps a (potentially nil) *http.Response and an error.

func NewResponseError

func NewResponseError(resp *http.Response, err error) *ResponseError

NewResponseError creates a new *ResponseError.

func (*ResponseError) Code

func (e *ResponseError) Code() int

Code returns the HTTP status code if the error includes an *http.Response. Otherwise returns 0.

func (*ResponseError) Error

func (e *ResponseError) Error() string

Error implements the error interface.

Jump to

Keyboard shortcuts

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