sdkerrors

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2025 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 BadRequestError

type BadRequestError struct {
	// The HTTP status code of the error. Useful when passing the response
	// body to child properties in a frontend UI. Must be returned as an integer.
	//
	Status int64 `json:"status"`
	// A short, human-readable summary of the problem. It should not
	// change between occurences of a problem, except for localization.
	// Should be provided as "Sentence case" for direct use in the UI.
	//
	Title string `json:"title"`
	// The error type.
	Type *string `json:"type,omitempty"`
	// Used to return the correlation ID back to the user, in the format
	// kong:trace:<correlation_id>. This helps us find the relevant logs
	// when a customer reports an issue.
	//
	Instance string `json:"instance"`
	// A human readable explanation specific to this occurence of the problem.
	// This field may contain request/entity data to help the user understand
	// what went wrong. Enclose variable values in square brackets. Should be
	// provided as "Sentence case" for direct use in the UI.
	//
	Detail string `json:"detail"`
	// invalid parameters
	InvalidParameters []components.InvalidParameters `json:"invalid_parameters"`
}

BadRequestError - standard error

func (*BadRequestError) Error

func (e *BadRequestError) Error() string

type ConflictError

type ConflictError struct {
	Status   any `json:"status"`
	Title    any `json:"title"`
	Type     any `json:"type,omitempty"`
	Instance any `json:"instance"`
	Detail   any `json:"detail"`
}

ConflictError - standard error

func (*ConflictError) Error

func (e *ConflictError) Error() string

type ForbiddenError

type ForbiddenError struct {
	Status   any `json:"status"`
	Title    any `json:"title"`
	Type     any `json:"type,omitempty"`
	Instance any `json:"instance"`
	Detail   any `json:"detail"`
}

ForbiddenError - standard error

func (*ForbiddenError) Error

func (e *ForbiddenError) Error() string

type GatewayUnauthorizedError

type GatewayUnauthorizedError struct {
	Message string `json:"message"`
	Status  int64  `json:"status"`
}

GatewayUnauthorizedError - Unauthorized

func (*GatewayUnauthorizedError) Error

func (e *GatewayUnauthorizedError) Error() string

type InternalServerError

type InternalServerError struct {
	// The HTTP status code.
	Status InternalServerErrorStatus `json:"status"`
	// The error response code.
	Title string `json:"title"`
	// The Konnect traceback code
	Instance string `json:"instance"`
	// Details about the error.
	Detail *string `json:"detail,omitempty"`
}

InternalServerError - The error response object.

func (*InternalServerError) Error

func (e *InternalServerError) Error() string

type InternalServerErrorStatus

type InternalServerErrorStatus int64

InternalServerErrorStatus - The HTTP status code.

const (
	InternalServerErrorStatusFiveHundred InternalServerErrorStatus = 500
)

func (InternalServerErrorStatus) ToPointer

func (*InternalServerErrorStatus) UnmarshalJSON

func (e *InternalServerErrorStatus) UnmarshalJSON(data []byte) error

type NotFoundError

type NotFoundError struct {
	Status   any `json:"status"`
	Title    any `json:"title"`
	Type     any `json:"type,omitempty"`
	Instance any `json:"instance"`
	Detail   any `json:"detail"`
}

NotFoundError - standard error

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

type PreconditionFailed

type PreconditionFailed struct {
	// The HTTP status code.
	Status *int64 `json:"status,omitempty"`
	// The error response code.
	Title *string `json:"title,omitempty"`
	// The Konnect traceback code.
	Instance *string `json:"instance,omitempty"`
	// Details about the error response.
	Detail *string `json:"detail,omitempty"`
}

PreconditionFailed - The error response object.

func (*PreconditionFailed) Error

func (e *PreconditionFailed) Error() string

type RateLimited

type RateLimited struct {
	// The HTTP response code
	Status *int64 `json:"status,omitempty"`
	// The Error response
	Title *string `json:"title,omitempty"`
	// The Konnect traceback ID.
	Instance *string `json:"instance,omitempty"`
	// Detailed explanation of the error response.
	Detail *string `json:"detail,omitempty"`
}

RateLimited - The error object

func (*RateLimited) Error

func (e *RateLimited) Error() string

type SDKError

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

func NewSDKError

func NewSDKError(message string, statusCode int, body string, httpRes *http.Response) *SDKError

func (*SDKError) Error

func (e *SDKError) Error() string

type ServiceUnavailable

type ServiceUnavailable struct {
	// The HTTP status code.
	Status Status `json:"status"`
	// The error response code.
	Title string `json:"title"`
	// The Konnect traceback code
	Instance string `json:"instance"`
	// Details about the error.
	Detail *string `json:"detail,omitempty"`
}

ServiceUnavailable - Error response for temporary service unavailability.

func (*ServiceUnavailable) Error

func (e *ServiceUnavailable) Error() string

type Status

type Status int64

Status - The HTTP status code.

const (
	StatusFiveHundredAndThree Status = 503
)

func (Status) ToPointer

func (e Status) ToPointer() *Status

func (*Status) UnmarshalJSON

func (e *Status) UnmarshalJSON(data []byte) error

type UnauthorizedError

type UnauthorizedError struct {
	Status   any `json:"status"`
	Title    any `json:"title"`
	Type     any `json:"type,omitempty"`
	Instance any `json:"instance"`
	Detail   any `json:"detail"`
}

UnauthorizedError - standard error

func (*UnauthorizedError) Error

func (e *UnauthorizedError) Error() string

type UnsupportedMediaTypeError added in v0.1.28

type UnsupportedMediaTypeError struct {
	Status   any `json:"status"`
	Title    any `json:"title"`
	Type     any `json:"type,omitempty"`
	Instance any `json:"instance"`
	Detail   any `json:"detail"`
}

UnsupportedMediaTypeError - standard error

func (*UnsupportedMediaTypeError) Error added in v0.1.28

func (e *UnsupportedMediaTypeError) Error() string

Jump to

Keyboard shortcuts

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