apierror

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 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 {
	Type   ErrorType   `json:"type,required"`
	Title  string      `json:"title,required"`
	Detail string      `json:"detail,required,nullable"`
	Status ErrorStatus `json:"status,required"`
	// All errors related to parsing the request parameters.
	Errors     []interface{} `json:"errors,required"`
	RetryAfter int64         `json:"retry_after,nullable"`
	JSON       errorJSON
	StatusCode int
	Request    *http.Request
	Response   *http.Response
}

TODO

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 (
	ErrorStatus400 ErrorStatus = 400
	ErrorStatus401 ErrorStatus = 401
	ErrorStatus403 ErrorStatus = 403
	ErrorStatus404 ErrorStatus = 404
	ErrorStatus409 ErrorStatus = 409
	ErrorStatus422 ErrorStatus = 422
	ErrorStatus429 ErrorStatus = 429
	ErrorStatus500 ErrorStatus = 500
)

type ErrorType

type ErrorType string
const (
	ErrorTypeRateLimitedError              ErrorType = "rate_limited_error"
	ErrorTypePrivateFeatureError           ErrorType = "private_feature_error"
	ErrorTypeObjectNotFoundError           ErrorType = "object_not_found_error"
	ErrorTypeMalformedRequestError         ErrorType = "malformed_request_error"
	ErrorTypeInvalidParametersError        ErrorType = "invalid_parameters_error"
	ErrorTypeInvalidOperationError         ErrorType = "invalid_operation_error"
	ErrorTypeInvalidAPIKeyError            ErrorType = "invalid_api_key_error"
	ErrorTypeInternalServerError           ErrorType = "internal_server_error"
	ErrorTypeInsufficientPermissionsError  ErrorType = "insufficient_permissions_error"
	ErrorTypeIdempotencyUnprocessableError ErrorType = "idempotency_unprocessable_error"
	ErrorTypeIdempotencyConflictError      ErrorType = "idempotency_conflict_error"
	ErrorTypeEnvironmentMismatchError      ErrorType = "environment_mismatch_error"
	ErrorTypeAPIMethodNotFoundError        ErrorType = "api_method_not_found_error"
)

Jump to

Keyboard shortcuts

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