apierror

package
v0.1.0-beta.3 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2025 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 {
	Code    string `json:"code,required"`
	Message string `json:"message,required"`
	Param   string `json:"param,required"`
	Type    string `json:"type,required"`
	// Metadata for the response, check the presence of optional fields with the
	// [resp.Field.IsPresent] method.
	JSON struct {
		Code        resp.Field
		Message     resp.Field
		Param       resp.Field
		Type        resp.Field
		ExtraFields map[string]resp.Field
		// contains filtered or unexported fields
	} `json:"-"`
	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) RawJSON

func (r Error) RawJSON() string

Returns the unmodified JSON received from the API

func (*Error) UnmarshalJSON

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

Jump to

Keyboard shortcuts

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