errorutils

package
v1.48.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: Apache-2.0 Imports: 6 Imported by: 203

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CheckError = func(err error) error {
	return err
}

Functions

func CheckErrorf added in v1.6.1

func CheckErrorf(format string, a ...interface{}) error

func CheckResponseStatus added in v0.2.2

func CheckResponseStatus(resp *http.Response, expectedStatusCodes ...int) error

Check expected status codes and return error if needed

func CheckResponseStatusWithBody added in v1.18.1

func CheckResponseStatusWithBody(resp *http.Response, body []byte, expectedStatusCodes ...int) error

Check expected status codes and return error with body if needed We use body variable that was saved outside the resp.body object, Instead of resp.Body because resp.body disappears after resp.body.Close()

func GenerateErrorString added in v1.28.2

func GenerateErrorString(bodyArray []byte) string

func GenerateResponseError added in v0.27.0

func GenerateResponseError(status, body string) error

Types

type OnErrorHandler

type OnErrorHandler func(error) error

Error modes (how should the application behave when the CheckError function is invoked):

Jump to

Keyboard shortcuts

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