Documentation ¶
Index ¶
- Constants
- type ClientError
- type Error
- type ServerError
- func (err *ServerError) Comment() string
- func (err *ServerError) Error() string
- func (err *ServerError) ErrorCode() string
- func (err *ServerError) HostId() string
- func (err *ServerError) HttpStatus() int
- func (err *ServerError) Message() string
- func (err *ServerError) OriginError() error
- func (err *ServerError) Recommend() string
- func (err *ServerError) RequestId() string
- type ServerErrorWrapper
- type SignatureDostNotMatchWrapper
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?" )
const code and msg
View Source
const ( SignatureDostNotMatchErrorCode = "SignatureDoesNotMatch" MessagePrefix = "Specified signature is not matched with our calculation. server string to sign is:" )
const code and msg prefix
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientError ¶
type ClientError struct {
// contains filtered or unexported fields
}
ClientError wrap error
func (*ClientError) ErrorCode ¶
func (err *ClientError) ErrorCode() string
ErrorCode returns error code
func (*ClientError) HttpStatus ¶
func (*ClientError) HttpStatus() int
HttpStatus returns DefaultClientErrorStatus
func (*ClientError) Message ¶
func (err *ClientError) Message() string
Message returns error message
func (*ClientError) OriginError ¶
func (err *ClientError) OriginError() error
OriginError returns originError
type Error ¶
type Error interface { error HttpStatus() int ErrorCode() string Message() string OriginError() error }
Error wrap error interface
func NewClientError ¶
NewClientError returns Error
func NewServerError ¶
NewServerError returns server error
type ServerError ¶
type ServerError struct {
// contains filtered or unexported fields
}
ServerError wrap error
func WrapServerError ¶
func WrapServerError(originError *ServerError, wrapInfo map[string]string) *ServerError
WrapServerError returns ServerError
func (*ServerError) Comment ¶
func (err *ServerError) Comment() string
Comment returns error's comment
func (*ServerError) ErrorCode ¶
func (err *ServerError) ErrorCode() string
ErrorCode returns error code
func (*ServerError) HttpStatus ¶
func (err *ServerError) HttpStatus() int
HttpStatus returns http status
func (*ServerError) OriginError ¶
func (err *ServerError) OriginError() error
OriginError returns nil
func (*ServerError) Recommend ¶
func (err *ServerError) Recommend() string
Recommend returns error's recommend
func (*ServerError) RequestId ¶
func (err *ServerError) RequestId() string
RequestId returns request id
type ServerErrorWrapper ¶
type ServerErrorWrapper interface {
// contains filtered or unexported methods
}
ServerErrorWrapper provides tryWrap func
type SignatureDostNotMatchWrapper ¶
type SignatureDostNotMatchWrapper struct{}
SignatureDostNotMatchWrapper implements tryWrap interface
Click to show internal directories.
Click to hide internal directories.