sdkerrors

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Code

type Code string

Code - A machine readable error code.

const (
	CodeBadRequest Code = "BAD_REQUEST"
)

func (Code) ToPointer

func (e Code) ToPointer() *Code

func (*Code) UnmarshalJSON

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

type ErrBadRequest

type ErrBadRequest struct {
	Error_ Error `json:"error"`
}

ErrBadRequest - The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).

func (*ErrBadRequest) Error

func (e *ErrBadRequest) Error() string

type ErrConflict

type ErrConflict struct {
	Error_ ErrConflictError `json:"error"`
}

ErrConflict - This response is sent when a request conflicts with the current state of the server.

func (*ErrConflict) Error

func (e *ErrConflict) Error() string

type ErrConflictCode

type ErrConflictCode string

ErrConflictCode - A machine readable error code.

const (
	ErrConflictCodeConflict ErrConflictCode = "CONFLICT"
)

func (ErrConflictCode) ToPointer

func (e ErrConflictCode) ToPointer() *ErrConflictCode

func (*ErrConflictCode) UnmarshalJSON

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

type ErrConflictError

type ErrConflictError struct {
	// A machine readable error code.
	Code ErrConflictCode `json:"code"`
	// A link to our documentation with more details about this error code
	Docs string `json:"docs"`
	// A human readable explanation of what went wrong
	Message string `json:"message"`
	// Please always include the requestId in your error report
	RequestID string `json:"requestId"`
}

func (*ErrConflictError) GetCode

func (o *ErrConflictError) GetCode() ErrConflictCode

func (*ErrConflictError) GetDocs

func (o *ErrConflictError) GetDocs() string

func (*ErrConflictError) GetMessage

func (o *ErrConflictError) GetMessage() string

func (*ErrConflictError) GetRequestID

func (o *ErrConflictError) GetRequestID() string

type ErrForbidden

type ErrForbidden struct {
	Error_ ErrForbiddenError `json:"error"`
}

ErrForbidden - The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server.

func (*ErrForbidden) Error

func (e *ErrForbidden) Error() string

type ErrForbiddenCode

type ErrForbiddenCode string

ErrForbiddenCode - A machine readable error code.

const (
	ErrForbiddenCodeForbidden ErrForbiddenCode = "FORBIDDEN"
)

func (ErrForbiddenCode) ToPointer

func (e ErrForbiddenCode) ToPointer() *ErrForbiddenCode

func (*ErrForbiddenCode) UnmarshalJSON

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

type ErrForbiddenError

type ErrForbiddenError struct {
	// A machine readable error code.
	Code ErrForbiddenCode `json:"code"`
	// A link to our documentation with more details about this error code
	Docs string `json:"docs"`
	// A human readable explanation of what went wrong
	Message string `json:"message"`
	// Please always include the requestId in your error report
	RequestID string `json:"requestId"`
}

func (*ErrForbiddenError) GetCode

func (o *ErrForbiddenError) GetCode() ErrForbiddenCode

func (*ErrForbiddenError) GetDocs

func (o *ErrForbiddenError) GetDocs() string

func (*ErrForbiddenError) GetMessage

func (o *ErrForbiddenError) GetMessage() string

func (*ErrForbiddenError) GetRequestID

func (o *ErrForbiddenError) GetRequestID() string

type ErrInternalServerError

type ErrInternalServerError struct {
	Error_ ErrInternalServerErrorError `json:"error"`
}

ErrInternalServerError - The server has encountered a situation it does not know how to handle.

func (*ErrInternalServerError) Error

func (e *ErrInternalServerError) Error() string

type ErrInternalServerErrorCode

type ErrInternalServerErrorCode string

ErrInternalServerErrorCode - A machine readable error code.

const (
	ErrInternalServerErrorCodeInternalServerError ErrInternalServerErrorCode = "INTERNAL_SERVER_ERROR"
)

func (ErrInternalServerErrorCode) ToPointer

func (*ErrInternalServerErrorCode) UnmarshalJSON

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

type ErrInternalServerErrorError

type ErrInternalServerErrorError struct {
	// A machine readable error code.
	Code ErrInternalServerErrorCode `json:"code"`
	// A link to our documentation with more details about this error code
	Docs string `json:"docs"`
	// A human readable explanation of what went wrong
	Message string `json:"message"`
	// Please always include the requestId in your error report
	RequestID string `json:"requestId"`
}

func (*ErrInternalServerErrorError) GetCode

func (*ErrInternalServerErrorError) GetDocs

func (o *ErrInternalServerErrorError) GetDocs() string

func (*ErrInternalServerErrorError) GetMessage

func (o *ErrInternalServerErrorError) GetMessage() string

func (*ErrInternalServerErrorError) GetRequestID

func (o *ErrInternalServerErrorError) GetRequestID() string

type ErrNotFound

type ErrNotFound struct {
	Error_ ErrNotFoundError `json:"error"`
}

ErrNotFound - The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web.

func (*ErrNotFound) Error

func (e *ErrNotFound) Error() string

type ErrNotFoundCode

type ErrNotFoundCode string

ErrNotFoundCode - A machine readable error code.

const (
	ErrNotFoundCodeNotFound ErrNotFoundCode = "NOT_FOUND"
)

func (ErrNotFoundCode) ToPointer

func (e ErrNotFoundCode) ToPointer() *ErrNotFoundCode

func (*ErrNotFoundCode) UnmarshalJSON

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

type ErrNotFoundError

type ErrNotFoundError struct {
	// A machine readable error code.
	Code ErrNotFoundCode `json:"code"`
	// A link to our documentation with more details about this error code
	Docs string `json:"docs"`
	// A human readable explanation of what went wrong
	Message string `json:"message"`
	// Please always include the requestId in your error report
	RequestID string `json:"requestId"`
}

func (*ErrNotFoundError) GetCode

func (o *ErrNotFoundError) GetCode() ErrNotFoundCode

func (*ErrNotFoundError) GetDocs

func (o *ErrNotFoundError) GetDocs() string

func (*ErrNotFoundError) GetMessage

func (o *ErrNotFoundError) GetMessage() string

func (*ErrNotFoundError) GetRequestID

func (o *ErrNotFoundError) GetRequestID() string

type ErrTooManyRequests

type ErrTooManyRequests struct {
	Error_ ErrTooManyRequestsError `json:"error"`
}

ErrTooManyRequests - The user has sent too many requests in a given amount of time ("rate limiting")

func (*ErrTooManyRequests) Error

func (e *ErrTooManyRequests) Error() string

type ErrTooManyRequestsCode

type ErrTooManyRequestsCode string

ErrTooManyRequestsCode - A machine readable error code.

const (
	ErrTooManyRequestsCodeTooManyRequests ErrTooManyRequestsCode = "TOO_MANY_REQUESTS"
)

func (ErrTooManyRequestsCode) ToPointer

func (*ErrTooManyRequestsCode) UnmarshalJSON

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

type ErrTooManyRequestsError

type ErrTooManyRequestsError struct {
	// A machine readable error code.
	Code ErrTooManyRequestsCode `json:"code"`
	// A link to our documentation with more details about this error code
	Docs string `json:"docs"`
	// A human readable explanation of what went wrong
	Message string `json:"message"`
	// Please always include the requestId in your error report
	RequestID string `json:"requestId"`
}

func (*ErrTooManyRequestsError) GetCode

func (*ErrTooManyRequestsError) GetDocs

func (o *ErrTooManyRequestsError) GetDocs() string

func (*ErrTooManyRequestsError) GetMessage

func (o *ErrTooManyRequestsError) GetMessage() string

func (*ErrTooManyRequestsError) GetRequestID

func (o *ErrTooManyRequestsError) GetRequestID() string

type ErrUnauthorized

type ErrUnauthorized struct {
	Error_ ErrUnauthorizedError `json:"error"`
}

ErrUnauthorized - Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response.

func (*ErrUnauthorized) Error

func (e *ErrUnauthorized) Error() string

type ErrUnauthorizedCode

type ErrUnauthorizedCode string

ErrUnauthorizedCode - A machine readable error code.

const (
	ErrUnauthorizedCodeUnauthorized ErrUnauthorizedCode = "UNAUTHORIZED"
)

func (ErrUnauthorizedCode) ToPointer

func (*ErrUnauthorizedCode) UnmarshalJSON

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

type ErrUnauthorizedError

type ErrUnauthorizedError struct {
	// A machine readable error code.
	Code ErrUnauthorizedCode `json:"code"`
	// A link to our documentation with more details about this error code
	Docs string `json:"docs"`
	// A human readable explanation of what went wrong
	Message string `json:"message"`
	// Please always include the requestId in your error report
	RequestID string `json:"requestId"`
}

func (*ErrUnauthorizedError) GetCode

func (*ErrUnauthorizedError) GetDocs

func (o *ErrUnauthorizedError) GetDocs() string

func (*ErrUnauthorizedError) GetMessage

func (o *ErrUnauthorizedError) GetMessage() string

func (*ErrUnauthorizedError) GetRequestID

func (o *ErrUnauthorizedError) GetRequestID() string

type Error

type Error struct {
	// A machine readable error code.
	Code Code `json:"code"`
	// A link to our documentation with more details about this error code
	Docs string `json:"docs"`
	// A human readable explanation of what went wrong
	Message string `json:"message"`
	// Please always include the requestId in your error report
	RequestID string `json:"requestId"`
}

func (*Error) GetCode

func (o *Error) GetCode() Code

func (*Error) GetDocs

func (o *Error) GetDocs() string

func (*Error) GetMessage

func (o *Error) GetMessage() string

func (*Error) GetRequestID

func (o *Error) GetRequestID() 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

Jump to

Keyboard shortcuts

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