errors

package
v4.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2021 License: Apache-2.0 Imports: 3 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithAction added in v4.2.0

func WithAction(action string) func(*SDKError)

WithAction set Action for SDKError

func WithContent added in v4.2.0

func WithContent(detail string) func(*UnhandledResponseError)

WithContent set Content for UnhandledResponseError

func WithError added in v4.2.0

func WithError(err error) func(*SDKError)

WithError set Err for SDKError

func WithHeader added in v4.2.0

func WithHeader(h http.Header) func(*UnhandledResponseError)

WithHeader set Header for UnhandledResponseError

func WithRequestID added in v4.2.0

func WithRequestID(id string) func(*SDKError)

WithRequestID set RequestID for SDKError

func WithStatusCode added in v4.2.0

func WithStatusCode(code int) func(*UnhandledResponseError)

WithStatusCode set StatusCode for UnhandledResponseError

Types

type ParameterRequiredError

type ParameterRequiredError struct {
	ParameterName string
	ParentName    string
}

ParameterRequiredError indicates that the required parameter is missing.

func (ParameterRequiredError) Error

func (e ParameterRequiredError) Error() string

Error returns the description of ParameterRequiredError.

type ParameterValueNotAllowedError

type ParameterValueNotAllowedError struct {
	ParameterName  string
	ParameterValue string
	AllowedValues  []string
}

ParameterValueNotAllowedError indicates that the parameter value is not allowed.

func (ParameterValueNotAllowedError) Error

Error returns the description of ParameterValueNotAllowedError.

type QingStorError

type QingStorError struct {
	StatusCode int

	Code         string `json:"code"`
	Message      string `json:"message"`
	RequestID    string `json:"request_id"`
	ReferenceURL string `json:"url"`
}

QingStorError stores information of an QingStor error response.

func (QingStorError) Error

func (qse QingStorError) Error() string

Error returns the description of QingStor error response.

type SDKError added in v4.2.0

type SDKError struct {
	Action    string
	RequestID string
	Err       error
}

SDKError stores information of an error return by sdk itself.

func NewSDKError added in v4.2.0

func NewSDKError(fs ...func(*SDKError)) SDKError

NewSDKError conduct a SDKError

func (SDKError) Error added in v4.2.0

func (e SDKError) Error() string

Error implement errors.Error

func (SDKError) Unwrap added in v4.2.0

func (e SDKError) Unwrap() error

Unwrap implement interface of errors

type UnhandledResponseError added in v4.2.0

type UnhandledResponseError struct {
	StatusCode int
	Header     http.Header
	Content    string
}

UnhandledResponseError stores information of an unhandled error response.

func NewUnhandledResponseError added in v4.2.0

func NewUnhandledResponseError(fs ...func(*UnhandledResponseError)) UnhandledResponseError

NewUnhandledResponseError conduct an unhandled response error

func (UnhandledResponseError) Error added in v4.2.0

func (e UnhandledResponseError) Error() string

Error returns the description of QingStor error response.

Jump to

Keyboard shortcuts

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