apierror

package
v0.618.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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" api:"required,nullable"`
	// All errors related to parsing the request parameters.
	Errors            []map[string]interface{} `json:"errors" api:"required"`
	Reason            ErrorReason              `json:"reason" api:"required"`
	ResourceID        string                   `json:"resource_id" api:"required"`
	Status            ErrorStatus              `json:"status" api:"required"`
	Title             string                   `json:"title" api:"required"`
	Type              ErrorType                `json:"type" api:"required"`
	LikelyEnvironment ErrorLikelyEnvironment   `json:"likely_environment" api:"nullable"`
	RetryAfter        int64                    `json:"retry_after" api:"nullable"`
	JSON              errorJSON                `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) UnmarshalJSON

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

type ErrorLikelyEnvironment added in v0.593.0

type ErrorLikelyEnvironment string
const (
	ErrorLikelyEnvironmentProduction ErrorLikelyEnvironment = "production"
	ErrorLikelyEnvironmentSandbox    ErrorLikelyEnvironment = "sandbox"
)

func (ErrorLikelyEnvironment) IsKnown added in v0.593.0

func (r ErrorLikelyEnvironment) IsKnown() bool

type ErrorReason

type ErrorReason string
const (
	ErrorReasonDeletedCredential ErrorReason = "deleted_credential"
	ErrorReasonExpiredCredential ErrorReason = "expired_credential"
	ErrorReasonIPNotAllowed      ErrorReason = "ip_not_allowed"
	ErrorReasonNoCredential      ErrorReason = "no_credential"
	ErrorReasonNoHeader          ErrorReason = "no_header"
	ErrorReasonNoAPIAccess       ErrorReason = "no_api_access"
	ErrorReasonWrongEnvironment  ErrorReason = "wrong_environment"
)

func (ErrorReason) IsKnown

func (r ErrorReason) IsKnown() bool

type ErrorStatus

type ErrorStatus int64
const (
	ErrorStatus429 ErrorStatus = 429
	ErrorStatus403 ErrorStatus = 403
	ErrorStatus404 ErrorStatus = 404
	ErrorStatus400 ErrorStatus = 400
	ErrorStatus409 ErrorStatus = 409
	ErrorStatus401 ErrorStatus = 401
	ErrorStatus500 ErrorStatus = 500
)

func (ErrorStatus) IsKnown

func (r ErrorStatus) IsKnown() bool

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"
	ErrorTypeIdempotencyKeyAlreadyUsedError ErrorType = "idempotency_key_already_used_error"
	ErrorTypeEnvironmentMismatchError       ErrorType = "environment_mismatch_error"
	ErrorTypeAPIMethodNotFoundError         ErrorType = "api_method_not_found_error"
)

func (ErrorType) IsKnown

func (r ErrorType) IsKnown() bool

Jump to

Keyboard shortcuts

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