Documentation ¶
Index ¶
- Constants
- Variables
- func AllowRecordErrEvent() bool
- func AllowRecordFlowLimitEvent() bool
- func BackoffErrWrapper(backErr, realErr error) error
- func ErrEqual(errCode string, err error) bool
- func RecordOpenAPIErrEvent(err error, fields ...EventInfoField)
- type APIRequestErr
- type APIRequestError
- type EventInfoField
- type OpenApiErrCodeChain
Constants ¶
View Source
const ( InvalidParameter = "InvalidParameter" MissingParameter = "MissingParameter" InternalError = "InternalError" InvalidVpcInvalidStatus = "InvalidVpc.InvalidStatus" InvalidEniInvalidStatus = "InvalidEni.InvalidStatus" InvalidEniIdNotFound = "InvalidEniId.NotFound" InvalidSubnetNotFound = "InvalidSubnet.NotFound" InvalidEniInstanceMismatch = "InvalidEni.InstanceMismatch" InvalidSubnetDisableIpv6 = "InvalidSubnet.DisableIpv6" LimitExceededPrivateIpsPerEni = "LimitExceeded.PrivateIpsPerEni" LimitExceededIpv6AddressesPerEni = "LimitExceeded.Ipv6AddressesPerEni" LimitExceededEnisPerInstance = "LimitExceeded.EnisPerInstance" QuotaExceededSecurityGroupIp = "QuotaExceeded.SecurityGroupIp" QuotaExceededEniSecurityGroup = "QuotaExceeded.EniSecurityGroup" QuotaExceededEni = "QuotaExceeded.Eni" InvalidPrivateIpMalformed = "InvalidPrivateIp.Malformed" InvalidIpv6Malformed = "InvalidIpv6.Malformed" InsufficientIpInSubnet = "InsufficientIpInSubnet" AccountFlowLimitExceeded = "AccountFlowLimitExceeded" FlowLimitExceeded = "FlowLimitExceeded" )
Variables ¶
Functions ¶
func AllowRecordErrEvent ¶
func AllowRecordErrEvent() bool
func AllowRecordFlowLimitEvent ¶
func AllowRecordFlowLimitEvent() bool
func BackoffErrWrapper ¶
BackoffErrWrapper wrap backoff error and true error of internal.
func RecordOpenAPIErrEvent ¶
func RecordOpenAPIErrEvent(err error, fields ...EventInfoField)
RecordOpenAPIErrEvent report Event with message according to APIRequestError, if message is "", a default message will be used.
Types ¶
type APIRequestErr ¶
type APIRequestErr struct {
// contains filtered or unexported fields
}
APIRequestErr is error wrapper of openapi sdk.
func (*APIRequestErr) Error ¶
func (e *APIRequestErr) Error() string
func (*APIRequestErr) ErrorCode ¶
func (e *APIRequestErr) ErrorCode() string
func (*APIRequestErr) ErrorCodeN ¶
func (e *APIRequestErr) ErrorCodeN() int
func (*APIRequestErr) Message ¶
func (e *APIRequestErr) Message() string
func (*APIRequestErr) RequestId ¶
func (e *APIRequestErr) RequestId() string
type APIRequestError ¶
type APIRequestError interface { error ErrorCodeN() int ErrorCode() string Message() string RequestId() string }
APIRequestError is interface of openapi sdk error wrapper.
func NewAPIRequestErr ¶
func NewAPIRequestErr(responseMetadata *response.ResponseMetadata, sdkErr error) APIRequestError
NewAPIRequestErr wrap openapi error and sdk error.
type EventInfoField ¶
type EventInfoField struct { Key string Value interface{} }
func (*EventInfoField) String ¶
func (f *EventInfoField) String() string
type OpenApiErrCodeChain ¶
type OpenApiErrCodeChain struct {
// contains filtered or unexported fields
}
OpenApiErrCodeChain used while assert errors with error code.
func (*OpenApiErrCodeChain) ErrChainEqual ¶
func (c *OpenApiErrCodeChain) ErrChainEqual(err error) bool
ErrChainEqual return ture if err is equal to any errCode in OpenApiErrCodeChain.
func (*OpenApiErrCodeChain) WithErrCodes ¶
func (c *OpenApiErrCodeChain) WithErrCodes(codes ...string) *OpenApiErrCodeChain
func (*OpenApiErrCodeChain) WithFlowLimitExceeded ¶
func (c *OpenApiErrCodeChain) WithFlowLimitExceeded() *OpenApiErrCodeChain
func (*OpenApiErrCodeChain) WithPublicErrCodes ¶
func (c *OpenApiErrCodeChain) WithPublicErrCodes() *OpenApiErrCodeChain
Click to show internal directories.
Click to hide internal directories.