-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
errors.go
101 lines (86 loc) · 4.46 KB
/
errors.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package ec2instanceconnect
import (
"github.com/aws/aws-sdk-go/private/protocol"
)
const (
// ErrCodeAuthException for service response error code
// "AuthException".
//
// Either your AWS credentials are not valid or you do not have access to the
// EC2 instance.
ErrCodeAuthException = "AuthException"
// ErrCodeEC2InstanceNotFoundException for service response error code
// "EC2InstanceNotFoundException".
//
// The specified instance was not found.
ErrCodeEC2InstanceNotFoundException = "EC2InstanceNotFoundException"
// ErrCodeEC2InstanceStateInvalidException for service response error code
// "EC2InstanceStateInvalidException".
//
// Unable to connect because the instance is not in a valid state. Connecting
// to a stopped or terminated instance is not supported. If the instance is
// stopped, start your instance, and try to connect again.
ErrCodeEC2InstanceStateInvalidException = "EC2InstanceStateInvalidException"
// ErrCodeEC2InstanceTypeInvalidException for service response error code
// "EC2InstanceTypeInvalidException".
//
// The instance type is not supported for connecting via the serial console.
// Only Nitro instance types are currently supported.
ErrCodeEC2InstanceTypeInvalidException = "EC2InstanceTypeInvalidException"
// ErrCodeEC2InstanceUnavailableException for service response error code
// "EC2InstanceUnavailableException".
//
// The instance is currently unavailable. Wait a few minutes and try again.
ErrCodeEC2InstanceUnavailableException = "EC2InstanceUnavailableException"
// ErrCodeInvalidArgsException for service response error code
// "InvalidArgsException".
//
// One of the parameters is not valid.
ErrCodeInvalidArgsException = "InvalidArgsException"
// ErrCodeSerialConsoleAccessDisabledException for service response error code
// "SerialConsoleAccessDisabledException".
//
// Your account is not authorized to use the EC2 Serial Console. To authorize
// your account, run the EnableSerialConsoleAccess API. For more information,
// see EnableSerialConsoleAccess (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_EnableSerialConsoleAccess.html)
// in the Amazon EC2 API Reference.
ErrCodeSerialConsoleAccessDisabledException = "SerialConsoleAccessDisabledException"
// ErrCodeSerialConsoleSessionLimitExceededException for service response error code
// "SerialConsoleSessionLimitExceededException".
//
// The instance currently has 1 active serial console session. Only 1 session
// is supported at a time.
ErrCodeSerialConsoleSessionLimitExceededException = "SerialConsoleSessionLimitExceededException"
// ErrCodeSerialConsoleSessionUnavailableException for service response error code
// "SerialConsoleSessionUnavailableException".
//
// Unable to start a serial console session. Please try again.
ErrCodeSerialConsoleSessionUnavailableException = "SerialConsoleSessionUnavailableException"
// ErrCodeServiceException for service response error code
// "ServiceException".
//
// The service encountered an error. Follow the instructions in the error message
// and try again.
ErrCodeServiceException = "ServiceException"
// ErrCodeThrottlingException for service response error code
// "ThrottlingException".
//
// The requests were made too frequently and have been throttled. Wait a while
// and try again. To increase the limit on your request frequency, contact AWS
// Support.
ErrCodeThrottlingException = "ThrottlingException"
)
var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{
"AuthException": newErrorAuthException,
"EC2InstanceNotFoundException": newErrorEC2InstanceNotFoundException,
"EC2InstanceStateInvalidException": newErrorEC2InstanceStateInvalidException,
"EC2InstanceTypeInvalidException": newErrorEC2InstanceTypeInvalidException,
"EC2InstanceUnavailableException": newErrorEC2InstanceUnavailableException,
"InvalidArgsException": newErrorInvalidArgsException,
"SerialConsoleAccessDisabledException": newErrorSerialConsoleAccessDisabledException,
"SerialConsoleSessionLimitExceededException": newErrorSerialConsoleSessionLimitExceededException,
"SerialConsoleSessionUnavailableException": newErrorSerialConsoleSessionUnavailableException,
"ServiceException": newErrorServiceException,
"ThrottlingException": newErrorThrottlingException,
}