sdkerrors

package
v0.9.108 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: Apache-2.0 Imports: 6 Imported by: 5 modules, 1 package

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 APIError

type APIError struct {
	Message     string
	StatusCode  int
	Body        string
	RawResponse *http.Response
}

func NewAPIError

func NewAPIError(message string, statusCode int, body string, httpRes *http.Response) *APIError

func (*APIError) Error

func (e *APIError) Error() string

type BadGateway added in v0.9.0

type BadGateway struct {
	CreatePrivateEndpointValidationFailedResponseError *CreatePrivateEndpointValidationFailedResponseError `queryParam:"inline" union:"member"`
	BadGatewayResponseError                            *BadGatewayResponseError                            `queryParam:"inline" union:"member"`

	Type BadGatewayType
}

BadGateway - An upstream dependency failed. When `activate` was passed and the draft was created, `data` carries it and any validation checks.

func CreateBadGatewayBadGatewayResponseError added in v0.9.0

func CreateBadGatewayBadGatewayResponseError(badGatewayResponseError BadGatewayResponseError) BadGateway

func CreateBadGatewayCreatePrivateEndpointValidationFailedResponseError added in v0.9.0

func CreateBadGatewayCreatePrivateEndpointValidationFailedResponseError(createPrivateEndpointValidationFailedResponseError CreatePrivateEndpointValidationFailedResponseError) BadGateway

func (BadGateway) Error added in v0.9.0

func (u BadGateway) Error() string

func (BadGateway) MarshalJSON added in v0.9.0

func (u BadGateway) MarshalJSON() ([]byte, error)

func (*BadGateway) UnmarshalJSON added in v0.9.0

func (u *BadGateway) UnmarshalJSON(data []byte) (err error)

type BadGatewayResponseError

type BadGatewayResponseError struct {
	// Error data for BadGatewayResponse
	Error_             components.BadGatewayResponseErrorData `json:"error"`
	OpenrouterMetadata map[string]any                         `json:"openrouter_metadata,omitzero"`
	UserID             *string                                `json:"user_id,omitzero"`
}

BadGatewayResponseError - Bad Gateway - Provider/upstream API failure

func (*BadGatewayResponseError) Error

func (e *BadGatewayResponseError) Error() string

type BadGatewayType added in v0.9.0

type BadGatewayType string
const (
	BadGatewayTypeCreatePrivateEndpointValidationFailedResponseError BadGatewayType = "CreatePrivateEndpointValidationFailedResponse_error"
	BadGatewayTypeBadGatewayResponseError                            BadGatewayType = "BadGatewayResponse_error"
)

type BadRequestResponseError

type BadRequestResponseError struct {
	// Error data for BadRequestResponse
	Error_             components.BadRequestResponseErrorData `json:"error"`
	OpenrouterMetadata map[string]any                         `json:"openrouter_metadata,omitzero"`
	UserID             *string                                `json:"user_id,omitzero"`
}

BadRequestResponseError - Bad Request - Invalid request parameters or malformed input

func (*BadRequestResponseError) Error

func (e *BadRequestResponseError) Error() string

type BatchErrorResponse added in v0.8.29

type BatchErrorResponse struct {
	Error_ components.BatchErrorResponseError `json:"error"`
}

func (*BatchErrorResponse) Error added in v0.8.29

func (e *BatchErrorResponse) Error() string

type BatchPaymentRequiredResponseError added in v0.8.29

type BatchPaymentRequiredResponseError struct {
	CompletionWindow components.BatchPaymentRequiredResponseCompletionWindow `json:"completion_window"`
	CreatedAt        int64                                                   `json:"created_at"`
	Endpoint         string                                                  `json:"endpoint"`
	Error_           components.BatchPaymentRequiredResponseError            `json:"error"`
	// Unix timestamp after which the assigned provider no longer completes unfinished requests. Derived from the provider's documented batch window, so it can exceed `created_at` plus `completion_window` (Google Vertex can take up to 96 hours). `null` when the provider documents no hard expiry.
	ExpiresAt   *int64                                        `json:"expires_at"`
	FinalizedAt *int64                                        `json:"finalized_at"`
	ID          string                                        `json:"id"`
	Model       string                                        `json:"model"`
	Object      components.BatchPaymentRequiredResponseObject `json:"object"`
	// Provider OpenRouter assigned to run the batch, using the same name as the `provider` field of sync responses.
	Provider      *string                                              `json:"provider"`
	RequestCounts components.BatchPaymentRequiredResponseRequestCounts `json:"request_counts"`
	// Always null: results are withheld until the batch charge is covered.
	Results any                                           `json:"results"`
	Status  components.BatchPaymentRequiredResponseStatus `json:"status"`
	Usage   *components.BatchPaymentRequiredResponseUsage `json:"usage"`
}

BatchPaymentRequiredResponseError - Batch metadata with results withheld (results: null) plus the standard error envelope. Add credits to unlock the already-computed results; the batch is not re-run.

func (*BatchPaymentRequiredResponseError) Error added in v0.8.29

type ClientClosedRequestResponseError added in v0.9.49

type ClientClosedRequestResponseError struct {
	// Error data for ClientClosedRequestResponse
	Error_             components.ClientClosedRequestResponseErrorData `json:"error"`
	OpenrouterMetadata map[string]any                                  `json:"openrouter_metadata,omitzero"`
	UserID             *string                                         `json:"user_id,omitzero"`
}

ClientClosedRequestResponseError - Client Closed Request - The caller cancelled the request

func (*ClientClosedRequestResponseError) Error added in v0.9.49

type Conflict added in v0.9.0

type Conflict struct {
	CreatePrivateEndpointValidationFailedResponseError *CreatePrivateEndpointValidationFailedResponseError `queryParam:"inline" union:"member"`
	ConflictResponseError                              *ConflictResponseError                              `queryParam:"inline" union:"member"`

	Type ConflictType
}

Conflict - The request conflicts with the endpoint state, such as a stale validation. When `activate` was passed and the draft was created, `data` carries it and any validation checks.

func CreateConflictConflictResponseError added in v0.9.0

func CreateConflictConflictResponseError(conflictResponseError ConflictResponseError) Conflict

func CreateConflictCreatePrivateEndpointValidationFailedResponseError added in v0.9.0

func CreateConflictCreatePrivateEndpointValidationFailedResponseError(createPrivateEndpointValidationFailedResponseError CreatePrivateEndpointValidationFailedResponseError) Conflict

func (Conflict) Error added in v0.9.0

func (u Conflict) Error() string

func (Conflict) MarshalJSON added in v0.9.0

func (u Conflict) MarshalJSON() ([]byte, error)

func (*Conflict) UnmarshalJSON added in v0.9.0

func (u *Conflict) UnmarshalJSON(data []byte) (err error)

type ConflictResponseError

type ConflictResponseError struct {
	// Error data for ConflictResponse
	Error_             components.ConflictResponseErrorData `json:"error"`
	OpenrouterMetadata map[string]any                       `json:"openrouter_metadata,omitzero"`
	UserID             *string                              `json:"user_id,omitzero"`
}

ConflictResponseError - Conflict - Resource conflict or concurrent modification

func (*ConflictResponseError) Error

func (e *ConflictResponseError) Error() string

type ConflictType added in v0.9.0

type ConflictType string
const (
	ConflictTypeCreatePrivateEndpointValidationFailedResponseError ConflictType = "CreatePrivateEndpointValidationFailedResponse_error"
	ConflictTypeConflictResponseError                              ConflictType = "ConflictResponse_error"
)

type CreatePrivateEndpointValidationFailedResponseError added in v0.9.0

type CreatePrivateEndpointValidationFailedResponseError struct {
	Data   components.CreatePrivateEndpointValidationFailedResponseData  `json:"data"`
	Error_ components.CreatePrivateEndpointValidationFailedResponseError `json:"error"`
}

func (*CreatePrivateEndpointValidationFailedResponseError) Error added in v0.9.0

type EdgeNetworkTimeoutResponseError

type EdgeNetworkTimeoutResponseError struct {
	// Error data for EdgeNetworkTimeoutResponse
	Error_             components.EdgeNetworkTimeoutResponseErrorData `json:"error"`
	OpenrouterMetadata map[string]any                                 `json:"openrouter_metadata,omitzero"`
	UserID             *string                                        `json:"user_id,omitzero"`
}

EdgeNetworkTimeoutResponseError - Infrastructure Timeout - Provider request timed out at edge network

func (*EdgeNetworkTimeoutResponseError) Error

type ForbiddenResponseError

type ForbiddenResponseError struct {
	// Error data for ForbiddenResponse
	Error_             components.ForbiddenResponseErrorData `json:"error"`
	OpenrouterMetadata map[string]any                        `json:"openrouter_metadata,omitzero"`
	UserID             *string                               `json:"user_id,omitzero"`
}

ForbiddenResponseError - Forbidden - Authentication successful but insufficient permissions

func (*ForbiddenResponseError) Error

func (e *ForbiddenResponseError) Error() string

type GatewayTimeoutResponseError added in v0.7.141

type GatewayTimeoutResponseError struct {
	// Error data for GatewayTimeoutResponse
	Error_             components.GatewayTimeoutResponseErrorData `json:"error"`
	OpenrouterMetadata map[string]any                             `json:"openrouter_metadata,omitzero"`
	UserID             *string                                    `json:"user_id,omitzero"`
}

GatewayTimeoutResponseError - Gateway Timeout - Provider did not respond before the upstream deadline

func (*GatewayTimeoutResponseError) Error added in v0.7.141

type GoneResponseError added in v0.7.133

type GoneResponseError struct {
	// Error data for GoneResponse
	Error_             components.GoneResponseErrorData `json:"error"`
	OpenrouterMetadata map[string]any                   `json:"openrouter_metadata,omitzero"`
	UserID             *string                          `json:"user_id,omitzero"`
}

GoneResponseError - Gone - Endpoint has been permanently removed or deprecated

func (*GoneResponseError) Error added in v0.7.133

func (e *GoneResponseError) Error() string

type InternalServerError added in v0.9.0

type InternalServerError struct {
	CreatePrivateEndpointValidationFailedResponseError *CreatePrivateEndpointValidationFailedResponseError `queryParam:"inline" union:"member"`
	InternalServerResponseError                        *InternalServerResponseError                        `queryParam:"inline" union:"member"`

	Type InternalServerErrorType
}

InternalServerError - Internal server error. When `activate` was passed and the draft was created, `data` carries it and any validation checks.

func CreateInternalServerErrorCreatePrivateEndpointValidationFailedResponseError added in v0.9.0

func CreateInternalServerErrorCreatePrivateEndpointValidationFailedResponseError(createPrivateEndpointValidationFailedResponseError CreatePrivateEndpointValidationFailedResponseError) InternalServerError

func CreateInternalServerErrorInternalServerResponseError added in v0.9.0

func CreateInternalServerErrorInternalServerResponseError(internalServerResponseError InternalServerResponseError) InternalServerError

func (InternalServerError) Error added in v0.9.0

func (u InternalServerError) Error() string

func (InternalServerError) MarshalJSON added in v0.9.0

func (u InternalServerError) MarshalJSON() ([]byte, error)

func (*InternalServerError) UnmarshalJSON added in v0.9.0

func (u *InternalServerError) UnmarshalJSON(data []byte) (err error)

type InternalServerErrorType added in v0.9.0

type InternalServerErrorType string
const (
	InternalServerErrorTypeCreatePrivateEndpointValidationFailedResponseError InternalServerErrorType = "CreatePrivateEndpointValidationFailedResponse_error"
	InternalServerErrorTypeInternalServerResponseError                        InternalServerErrorType = "InternalServerResponse_error"
)

type InternalServerResponseError

type InternalServerResponseError struct {
	// Error data for InternalServerResponse
	Error_             components.InternalServerResponseErrorData `json:"error"`
	OpenrouterMetadata map[string]any                             `json:"openrouter_metadata,omitzero"`
	UserID             *string                                    `json:"user_id,omitzero"`
}

InternalServerResponseError - Internal Server Error - Unexpected server error

func (*InternalServerResponseError) Error

type NotFound added in v0.9.0

type NotFound struct {
	CreatePrivateEndpointValidationFailedResponseError *CreatePrivateEndpointValidationFailedResponseError `queryParam:"inline" union:"member"`
	NotFoundResponseError                              *NotFoundResponseError                              `queryParam:"inline" union:"member"`

	Type NotFoundType
}

NotFound - The model, provider, or validation workspace was not found. When `activate` was passed and the draft was created, `data` carries it and any validation checks.

func CreateNotFoundCreatePrivateEndpointValidationFailedResponseError added in v0.9.0

func CreateNotFoundCreatePrivateEndpointValidationFailedResponseError(createPrivateEndpointValidationFailedResponseError CreatePrivateEndpointValidationFailedResponseError) NotFound

func CreateNotFoundNotFoundResponseError added in v0.9.0

func CreateNotFoundNotFoundResponseError(notFoundResponseError NotFoundResponseError) NotFound

func (NotFound) Error added in v0.9.0

func (u NotFound) Error() string

func (NotFound) MarshalJSON added in v0.9.0

func (u NotFound) MarshalJSON() ([]byte, error)

func (*NotFound) UnmarshalJSON added in v0.9.0

func (u *NotFound) UnmarshalJSON(data []byte) (err error)

type NotFoundResponseError

type NotFoundResponseError struct {
	// Error data for NotFoundResponse
	Error_             components.NotFoundResponseErrorData `json:"error"`
	OpenrouterMetadata map[string]any                       `json:"openrouter_metadata,omitzero"`
	UserID             *string                              `json:"user_id,omitzero"`
}

NotFoundResponseError - Not Found - Resource does not exist

func (*NotFoundResponseError) Error

func (e *NotFoundResponseError) Error() string

type NotFoundType added in v0.9.0

type NotFoundType string
const (
	NotFoundTypeCreatePrivateEndpointValidationFailedResponseError NotFoundType = "CreatePrivateEndpointValidationFailedResponse_error"
	NotFoundTypeNotFoundResponseError                              NotFoundType = "NotFoundResponse_error"
)

type OAuthErrorResponse added in v0.7.112

type OAuthErrorResponse struct {
	Error_           components.ErrorEnum `json:"error"`
	ErrorDescription string               `json:"error_description"`
}

OAuthErrorResponse - RFC 6749 §5.2 error response.

func (*OAuthErrorResponse) Error added in v0.7.112

func (e *OAuthErrorResponse) Error() string

type PayloadTooLargeResponseError

type PayloadTooLargeResponseError struct {
	// Error data for PayloadTooLargeResponse
	Error_             components.PayloadTooLargeResponseErrorData `json:"error"`
	OpenrouterMetadata map[string]any                              `json:"openrouter_metadata,omitzero"`
	UserID             *string                                     `json:"user_id,omitzero"`
}

PayloadTooLargeResponseError - Payload Too Large - Request payload exceeds size limits

func (*PayloadTooLargeResponseError) Error

type PaymentRequiredResponseError

type PaymentRequiredResponseError struct {
	// Error data for PaymentRequiredResponse
	Error_             components.PaymentRequiredResponseErrorData `json:"error"`
	OpenrouterMetadata map[string]any                              `json:"openrouter_metadata,omitzero"`
	UserID             *string                                     `json:"user_id,omitzero"`
}

PaymentRequiredResponseError - Payment Required - Insufficient credits or quota to complete request

func (*PaymentRequiredResponseError) Error

type ProviderOverloadedResponseError

type ProviderOverloadedResponseError struct {
	// Error data for ProviderOverloadedResponse
	Error_             components.ProviderOverloadedResponseErrorData `json:"error"`
	OpenrouterMetadata map[string]any                                 `json:"openrouter_metadata,omitzero"`
	UserID             *string                                        `json:"user_id,omitzero"`
}

ProviderOverloadedResponseError - Provider Overloaded - Provider is temporarily overloaded

func (*ProviderOverloadedResponseError) Error

type RequestTimeoutResponseError

type RequestTimeoutResponseError struct {
	// Error data for RequestTimeoutResponse
	Error_             components.RequestTimeoutResponseErrorData `json:"error"`
	OpenrouterMetadata map[string]any                             `json:"openrouter_metadata,omitzero"`
	UserID             *string                                    `json:"user_id,omitzero"`
}

RequestTimeoutResponseError - Request Timeout - Operation exceeded time limit

func (*RequestTimeoutResponseError) Error

type ResponseValidationError added in v0.9.88

type ResponseValidationError struct {
	Message     string
	StatusCode  int
	Body        string
	RawResponse *http.Response
	Cause       error
}

func NewResponseValidationError added in v0.9.88

func NewResponseValidationError(message string, statusCode int, body string, httpRes *http.Response, cause error) *ResponseValidationError

func (*ResponseValidationError) Error added in v0.9.88

func (e *ResponseValidationError) Error() string

func (*ResponseValidationError) Unwrap added in v0.9.88

func (e *ResponseValidationError) Unwrap() error

type ServiceUnavailableResponseError

type ServiceUnavailableResponseError struct {
	// Error data for ServiceUnavailableResponse
	Error_             components.ServiceUnavailableResponseErrorData `json:"error"`
	OpenrouterMetadata map[string]any                                 `json:"openrouter_metadata,omitzero"`
	UserID             *string                                        `json:"user_id,omitzero"`
}

ServiceUnavailableResponseError - Service Unavailable - Service temporarily unavailable

func (*ServiceUnavailableResponseError) Error

type TooManyRequestsResponseError

type TooManyRequestsResponseError struct {
	// Error data for TooManyRequestsResponse
	Error_             components.TooManyRequestsResponseErrorData `json:"error"`
	OpenrouterMetadata map[string]any                              `json:"openrouter_metadata,omitzero"`
	UserID             *string                                     `json:"user_id,omitzero"`
}

TooManyRequestsResponseError - Too Many Requests - Rate limit exceeded

func (*TooManyRequestsResponseError) Error

type UnauthorizedResponseError

type UnauthorizedResponseError struct {
	// Error data for UnauthorizedResponse
	Error_             components.UnauthorizedResponseErrorData `json:"error"`
	OpenrouterMetadata map[string]any                           `json:"openrouter_metadata,omitzero"`
	UserID             *string                                  `json:"user_id,omitzero"`
}

UnauthorizedResponseError - Unauthorized - Authentication required or invalid credentials

func (*UnauthorizedResponseError) Error

func (e *UnauthorizedResponseError) Error() string

type UnprocessableEntity added in v0.9.0

type UnprocessableEntity struct {
	CreatePrivateEndpointValidationFailedResponseError *CreatePrivateEndpointValidationFailedResponseError `queryParam:"inline" union:"member"`
	UnprocessableEntityResponseError                   *UnprocessableEntityResponseError                   `queryParam:"inline" union:"member"`

	Type UnprocessableEntityType
}

UnprocessableEntity - The request was invalid, or validation failed. When `activate` was passed and the draft was created, `data` carries it and any validation checks.

func CreateUnprocessableEntityCreatePrivateEndpointValidationFailedResponseError added in v0.9.0

func CreateUnprocessableEntityCreatePrivateEndpointValidationFailedResponseError(createPrivateEndpointValidationFailedResponseError CreatePrivateEndpointValidationFailedResponseError) UnprocessableEntity

func CreateUnprocessableEntityUnprocessableEntityResponseError added in v0.9.0

func CreateUnprocessableEntityUnprocessableEntityResponseError(unprocessableEntityResponseError UnprocessableEntityResponseError) UnprocessableEntity

func (UnprocessableEntity) Error added in v0.9.0

func (u UnprocessableEntity) Error() string

func (UnprocessableEntity) MarshalJSON added in v0.9.0

func (u UnprocessableEntity) MarshalJSON() ([]byte, error)

func (*UnprocessableEntity) UnmarshalJSON added in v0.9.0

func (u *UnprocessableEntity) UnmarshalJSON(data []byte) (err error)

type UnprocessableEntityResponseError

type UnprocessableEntityResponseError struct {
	// Error data for UnprocessableEntityResponse
	Error_             components.UnprocessableEntityResponseErrorData `json:"error"`
	OpenrouterMetadata map[string]any                                  `json:"openrouter_metadata,omitzero"`
	UserID             *string                                         `json:"user_id,omitzero"`
}

UnprocessableEntityResponseError - Unprocessable Entity - Semantic validation failure

func (*UnprocessableEntityResponseError) Error

type UnprocessableEntityType added in v0.9.0

type UnprocessableEntityType string
const (
	UnprocessableEntityTypeCreatePrivateEndpointValidationFailedResponseError UnprocessableEntityType = "CreatePrivateEndpointValidationFailedResponse_error"
	UnprocessableEntityTypeUnprocessableEntityResponseError                   UnprocessableEntityType = "UnprocessableEntityResponse_error"
)

Jump to

Keyboard shortcuts

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