Help us shape the future of Go! Take the 2026 Go Developer Survey

errors

package
v1.41.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: Apache-2.0 Imports: 3 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 {
	// contains filtered or unexported fields
}

ApiError is an improved error class.

func Convert

func Convert(data []byte, err error) ([]byte, *ApiError)

Convert data and a std err to an api err.

func New

func New(err error) *ApiError

New creates a new error from an error.

func NewF

func NewF(format string, a ...interface{}) *ApiError

NewF creates a new formatted error.

func NewS

func NewS(msg string) *ApiError

NewS creates a new error from a string.

func (*ApiError) And

func (e *ApiError) And(f *ApiError) *ApiError

And ands two errors.

func (*ApiError) Error

func (e *ApiError) Error() string

func (*ApiError) Grow

func (e *ApiError) Grow(msg string) *ApiError

Grow adds to an error and returns it.

func (*ApiError) HttpResponse

func (e *ApiError) HttpResponse() *http.Response

func (*ApiError) Or

func (e *ApiError) Or(f *ApiError) *ApiError

Or coalesces two errors.

func (*ApiError) String

func (e *ApiError) String() string

func (*ApiError) WithResponse

func (e *ApiError) WithResponse(httpResponse *http.Response) *ApiError

Jump to

Keyboard shortcuts

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