errors

package
v1.61.1843 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2022 License: Apache-2.0 Imports: 5 Imported by: 147

Documentation

Index

Constants

View Source
const (
	DefaultClientErrorStatus = 400
	DefaultClientErrorCode   = "SDK.ClientError"

	UnsupportedCredentialErrorCode    = "SDK.UnsupportedCredential"
	UnsupportedCredentialErrorMessage = "Specified credential (type = %s) is not supported, please check"

	CanNotResolveEndpointErrorCode    = "SDK.CanNotResolveEndpoint"
	CanNotResolveEndpointErrorMessage = "Can not resolve endpoint(param = %s), please check your accessKey with secret, and read the user guide\n %s"

	UnsupportedParamPositionErrorCode    = "SDK.UnsupportedParamPosition"
	UnsupportedParamPositionErrorMessage = "Specified param position (%s) is not supported, please upgrade sdk and retry"

	AsyncFunctionNotEnabledCode    = "SDK.AsyncFunctionNotEnabled"
	AsyncFunctionNotEnabledMessage = "Async function is not enabled in client, please invoke 'client.EnableAsync' function"

	UnknownRequestTypeErrorCode    = "SDK.UnknownRequestType"
	UnknownRequestTypeErrorMessage = "Unknown Request Type: %s"

	MissingParamErrorCode = "SDK.MissingParam"
	InvalidParamErrorCode = "SDK.InvalidParam"

	JsonUnmarshalErrorCode    = "SDK.JsonUnmarshalError"
	JsonUnmarshalErrorMessage = "Failed to unmarshal response, but you can get the data via response.GetHttpStatusCode() and response.GetHttpContentString()"

	TimeoutErrorCode    = "SDK.TimeoutError"
	TimeoutErrorMessage = "The request timed out %s times(%s for retry), perhaps we should have the threshold raised a little?"
)
View Source
const IncompleteSignatureErrorCode = "IncompleteSignature"
View Source
const MessageContain = "server string to sign is:"
View Source
const SignatureDostNotMatchErrorCode = "SignatureDoesNotMatch"

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientError

type ClientError struct {
	// contains filtered or unexported fields
}

func (*ClientError) Error

func (err *ClientError) Error() string

func (*ClientError) ErrorCode

func (err *ClientError) ErrorCode() string

func (*ClientError) HttpStatus

func (*ClientError) HttpStatus() int

func (*ClientError) Message

func (err *ClientError) Message() string

func (*ClientError) OriginError

func (err *ClientError) OriginError() error

func (*ClientError) String

func (err *ClientError) String() string

type Error

type Error interface {
	error
	HttpStatus() int
	ErrorCode() string
	Message() string
	OriginError() error
}

func NewClientError

func NewClientError(errorCode, message string, originErr error) Error

func NewServerError

func NewServerError(httpStatus int, responseContent, comment string) Error

type ServerError

type ServerError struct {
	RespHeaders map[string][]string
	// contains filtered or unexported fields
}

func WrapServerError

func WrapServerError(originError *ServerError, wrapInfo map[string]string) *ServerError

func (*ServerError) Comment

func (err *ServerError) Comment() string

func (*ServerError) Error

func (err *ServerError) Error() string

func (*ServerError) ErrorCode

func (err *ServerError) ErrorCode() string

func (*ServerError) HostId

func (err *ServerError) HostId() string

func (*ServerError) HttpStatus

func (err *ServerError) HttpStatus() int

func (*ServerError) Message

func (err *ServerError) Message() string

func (*ServerError) OriginError

func (err *ServerError) OriginError() error

func (*ServerError) Recommend

func (err *ServerError) Recommend() string

func (*ServerError) RequestId

func (err *ServerError) RequestId() string

type ServerErrorWrapper

type ServerErrorWrapper interface {
	// contains filtered or unexported methods
}

type SignatureDostNotMatchWrapper

type SignatureDostNotMatchWrapper struct {
}

Jump to

Keyboard shortcuts

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