Help us shape the future of Go! Take the 2026 Go Developer Survey

sdkerrors

package
v0.7.161 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2026 License: Apache-2.0 Imports: 4 Imported by: 1

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 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 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 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 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 InternChatErrorResponse added in v0.7.150

type InternChatErrorResponse struct {
	// The OpenAI-compatible error object. `metadata` is present on refusals from the chat route. Authentication refusals (`401`), the departed-creator `403` and the programme `404` carry only `code` and `message`.
	Error_ components.InternChatError `json:"error"`
}

InternChatErrorResponse - A refusal before the stream opens. Once the response is `200` and streaming, failures arrive as a chunk with `finish_reason: "error"` instead.

func (*InternChatErrorResponse) Error added in v0.7.150

func (e *InternChatErrorResponse) Error() string

type InternLifecycleError added in v0.7.148

type InternLifecycleError struct {
	Error_ components.InternLifecycleErrorError `json:"error"`
}

InternLifecycleError - Intern lifecycle request failure.

func (*InternLifecycleError) Error added in v0.7.148

func (e *InternLifecycleError) Error() string

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 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 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 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 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

Jump to

Keyboard shortcuts

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