apierror

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	Detail string `json:"detail,required,nullable"`
	// All errors related to parsing the request parameters.
	Errors     []interface{} `json:"errors,required"`
	Status     ErrorStatus   `json:"status,required"`
	Title      string        `json:"title,required"`
	Type       ErrorType     `json:"type,required"`
	RetryAfter int64         `json:"retry_after,nullable"`
	JSON       errorJSON
	StatusCode int
	Request    *http.Request
	Response   *http.Response
}

Error represents an error that originates from the API, i.e. when a request is made and the API returns a response with a HTTP status code. Other errors are not wrapped by this SDK.

func (*Error) DumpRequest

func (r *Error) DumpRequest(body bool) []byte

func (*Error) DumpResponse

func (r *Error) DumpResponse(body bool) []byte

func (*Error) Error

func (r *Error) Error() string

func (*Error) UnmarshalJSON

func (r *Error) UnmarshalJSON(data []byte) (err error)

type ErrorStatus

type ErrorStatus int64
const (
	ErrorStatus429 ErrorStatus = 429
)

type ErrorType

type ErrorType string
const (
	ErrorTypeRateLimitedError ErrorType = "rate_limited_error"
)

Jump to

Keyboard shortcuts

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