apierror

package
v0.6.15 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0, MIT Imports: 5 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeError

func DecodeError(data []byte) error

func EncodeError

func EncodeError(err error) []byte

func FromResponse

func FromResponse(status int, body []byte) error

Types

type Error

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

Error is the type of error returned by a network client. It contains an HTTP status code so that API clients can interpret the error emssage.

func New

func New(err error, status int) *Error

func (*Error) Error

func (e *Error) Error() string

func (*Error) Status

func (e *Error) Status() int

func (*Error) Text

func (e *Error) Text() string

func (*Error) Unwrap

func (e *Error) Unwrap() error

type ErrorMessage

type ErrorMessage struct {
	Message string `json:",omitempty"`
	Status  int    `json:",omitempty"`
}

Jump to

Keyboard shortcuts

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