errors

package
v1.6.2-rc Latest Latest
Warning

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

Go to latest
Published: May 24, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

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

View Source
var (
	ErrNotFound                 = errors.New("not found")
	ErrHalfwayFailed            = errors.New("process halfway failed")
	ErrInvalidDeletionPrimaryIP = errors.New("ip is primary, deletion invalid")
)

Functions

func AllowRecordErrEvent

func AllowRecordErrEvent() bool

func AllowRecordFlowLimitEvent

func AllowRecordFlowLimitEvent() bool

func BackoffErrWrapper

func BackoffErrWrapper(backErr, realErr error) error

BackoffErrWrapper wrap backoff error and true error of internal.

func ErrEqual

func ErrEqual(errCode string, err error) bool

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

Jump to

Keyboard shortcuts

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