Documentation ¶
Overview ¶
Package error
Index ¶
- type AwsErrorMessage
- type AwsMessage
- type BasicError
- type ErrorType
- type FinalError
- func GenericKunFinalError(err error) FinalError
- func NewAccountProblemException(cause string, lasterr error) FinalError
- func NewGenericException(err BasicError, lasterr error) FinalError
- func NewInvalidInvokeCallerException(cause string, lasterr error) FinalError
- func NewInvalidParameterValueException(cause string, lasterr error) FinalError
- func NewInvalidRequestContentException(cause string, lasterr error) FinalError
- func NewInvalidRuntimeException(cause string, lasterr error) FinalError
- func NewNotImplementedException() FinalError
- func NewRequestTimeoutException(cause string, timeout time.Duration, lasterr error) FinalError
- func NewResourceNotFoundException(cause string, lasterr error) FinalError
- func NewServiceException(cause string, lasterr error) FinalError
- func NewTooManyRequestsException(cause string, lasterr error) FinalError
- func NewUnrecognizedClientException(cause string, lasterr error) FinalError
- func NewValidationException(cause, message string, lasterr error) FinalError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AwsErrorMessage ¶
type AwsErrorMessage struct {
ErrorMessage string `json:"errorMessage"`
}
AwsErrorMessage Example:
{ "errorMessage": "2018-05-10T06:42:59.753Z 5f46a493-541d-11e8-a58a-ed2562190b91 Task timed out after 3.00 seconds" }
func (*AwsErrorMessage) String ¶
func (m *AwsErrorMessage) String() string
type AwsMessage ¶
type AwsMessage struct {
Message string `json:"message"`
}
AwsMessage Example:
{ "message": "The security token included in the request is invalid." }
type BasicError ¶
type BasicError struct { Code ErrorType `json:"Code,omitempty"` Cause string `json:"Cause,omitempty"` Message string `json:"Message"` Status int `json:"Status,omitempty"` Type string `json:"Type,omitempty"` }
BasicError struct
func (BasicError) Error ¶
func (err BasicError) Error() string
Error struct compatible with standard `error` interface
type ErrorType ¶
type ErrorType string
ErrorType is the alias of string
const ( // ResourceNotFoundException = The resource (for example, a function or access policy // statement) specified in the request does not exist. ResourceNotFoundException ErrorType = "ResourceNotFoundException" UserNotFoundException ErrorType = "UserNotFoundException" // TooManyRequestsException xxx TooManyRequestsException ErrorType = "TooManyRequestsException" // External error face to user InvalidParameterValueException ErrorType = "InvalidParameterValueException" InvalidRequestContentException ErrorType = "InvalidRequestContentException" PolicyLengthExceededException ErrorType = "PolicyLengthExceededException" ServiceException ErrorType = "ServiceException" UnrecognizedClientException ErrorType = "UnrecognizedClientException" UnsupportedMediaTypeException ErrorType = "UnsupportedMediaTypeException" ValidationException ErrorType = "ValidationException" // service defined error NotImplementedException ErrorType = "NotImplementedException" RequestTimeoutException ErrorType = "RequestTimeoutException" AccountProblemException ErrorType = "AccountProblemException" InvalidInvokeCallerException ErrorType = "InvalidInvokeCallerException" )
Error types is the brief introduction of error types, and it's the key to navigate the message below.
const ( // InvalidRuntimeException = The runtime or runtime version specified is not supported. InvalidRuntimeException ErrorType = "InvalidRuntimeException" )
type FinalError ¶
type FinalError struct { BasicError Backtrace []BasicError `json:"Backtrace,omitempty"` }
FinalError preserve the error stack
func GenericKunFinalError ¶
func GenericKunFinalError(err error) FinalError
func NewAccountProblemException ¶
func NewAccountProblemException(cause string, lasterr error) FinalError
NewAccountProblemException xxx
func NewGenericException ¶
func NewGenericException(err BasicError, lasterr error) FinalError
NewGenericException xxx
func NewInvalidInvokeCallerException ¶
func NewInvalidInvokeCallerException(cause string, lasterr error) FinalError
NewInvalidInvokeCallerException xxx
func NewInvalidParameterValueException ¶
func NewInvalidParameterValueException(cause string, lasterr error) FinalError
NewInvalidParameterValueException xxx
func NewInvalidRequestContentException ¶
func NewInvalidRequestContentException(cause string, lasterr error) FinalError
NewInvalidRequestContentException xxx
func NewInvalidRuntimeException ¶
func NewInvalidRuntimeException(cause string, lasterr error) FinalError
NewInvalidRuntimeException creates a InvalidRuntimeException HTTP status code is StatusBadGateway (502)
func NewNotImplementedException ¶
func NewNotImplementedException() FinalError
NewNotImplementedException xxx
func NewRequestTimeoutException ¶
func NewRequestTimeoutException(cause string, timeout time.Duration, lasterr error) FinalError
NewRequestTimeoutException xxx
func NewResourceNotFoundException ¶
func NewResourceNotFoundException(cause string, lasterr error) FinalError
func NewServiceException ¶
func NewServiceException(cause string, lasterr error) FinalError
NewServiceException xxx
func NewTooManyRequestsException ¶
func NewTooManyRequestsException(cause string, lasterr error) FinalError
NewTooManyRequestsException xxx
func NewUnrecognizedClientException ¶
func NewUnrecognizedClientException(cause string, lasterr error) FinalError
NewUnrecognizedClientException creates a UnrecognizedClientException HTTP status code is StatusForbidden (403)
func NewValidationException ¶
func NewValidationException(cause, message string, lasterr error) FinalError
NewValidationException xxx
func (FinalError) Error ¶
func (f FinalError) Error() string
func (FinalError) WriteTo ¶
func (err FinalError) WriteTo(w http.ResponseWriter) FinalError
WriteTo xxx