line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
package SRS::EPP::Response::Error::Map; |
3
|
|
|
|
|
|
|
{ |
4
|
|
|
|
|
|
|
$SRS::EPP::Response::Error::Map::VERSION = '0.22'; |
5
|
|
|
|
|
|
|
} |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
4049
|
use YAML; |
|
1
|
|
|
|
|
10070
|
|
|
1
|
|
|
|
|
62
|
|
8
|
1
|
|
|
1
|
|
11
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
52
|
|
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
|
|
19
|
use Sub::Exporter -setup => { |
11
|
|
|
|
|
|
|
exports => [ |
12
|
|
|
|
|
|
|
qw(map_srs_error_code map_srs_error |
13
|
|
|
|
|
|
|
ERROR_MAP HINT_CODE_FALLBACK SEVERITY_FALLBACK) |
14
|
|
|
|
|
|
|
] |
15
|
1
|
|
|
1
|
|
7
|
}; |
|
1
|
|
|
|
|
2
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
# map SRS codes to EPP codes. Remember that this list squashes a lot |
18
|
|
|
|
|
|
|
# of errors to 2400 which, if the requests weren't generated by us, |
19
|
|
|
|
|
|
|
# would be a different code. |
20
|
|
|
|
|
|
|
|
21
|
1
|
|
|
|
|
175
|
use constant ERROR_MAP => { |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# 20x errors are technically supposed to indicate EPP protocol |
24
|
|
|
|
|
|
|
# violations; 2002 means 'command use error' and indicates |
25
|
|
|
|
|
|
|
# that what the registrar is trying to do doesn't make sense |
26
|
|
|
|
|
|
|
# semantically. These might be better as 2400. |
27
|
|
|
|
|
|
|
CONFLICTING_RESULTS_PARAMETERS => 2002, |
28
|
|
|
|
|
|
|
DELETE_FLAG_WITH_OTHER_FIELDS => 2002, |
29
|
|
|
|
|
|
|
DOMAIN_CANCEL_AND_RENEW => 2002, |
30
|
|
|
|
|
|
|
INVALID_FIELDSET => 2002, |
31
|
|
|
|
|
|
|
MESSAGE_DOES_NOT_EXIST => 2002, |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
# 22xx are for security; 2200 means 'login failed', so any |
34
|
|
|
|
|
|
|
# kind of PGP error will map to that. |
35
|
|
|
|
|
|
|
PUBLIC_KEY_INVALID => 2200, |
36
|
|
|
|
|
|
|
SIG_INVALID => 2200, |
37
|
|
|
|
|
|
|
SIG_VERIFY_FAILED => 2200, |
38
|
|
|
|
|
|
|
UNKNOWN_REGISTRAR => 2200, |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
# 2201 means "Authorization error", eg, no permissions to do |
41
|
|
|
|
|
|
|
# that *type* of operation. |
42
|
|
|
|
|
|
|
DOMAIN_ASSIGNED_TO_NON_REGISTRAR => 2201, |
43
|
|
|
|
|
|
|
LOCK_ATTEMPT => 2201, |
44
|
|
|
|
|
|
|
MODERATED_DOMAIN_VIOLATION => 2201, |
45
|
|
|
|
|
|
|
NOT_PERMITTED_TO_FILTER_REGISTRAR_BY_NAME => 2201, |
46
|
|
|
|
|
|
|
PERMISSION_DENIED => 2201, |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
# 2202 means credentials error |
49
|
|
|
|
|
|
|
UDAI_DOMAIN_MISMATCH => 2202, |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
# 2302 : An error because something already exists |
52
|
|
|
|
|
|
|
ALREADY_ACKED_MESSAGE => 2302, |
53
|
|
|
|
|
|
|
DOMAIN_ALREADY_EXISTS => 2302, |
54
|
|
|
|
|
|
|
HANDLE_ALREADY_EXISTS => 2302, |
55
|
|
|
|
|
|
|
JOB_ALREADY_EXISTS => 2302, |
56
|
|
|
|
|
|
|
LIST_ENTRY_ALREADY_EXISTS => 2302, |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
# 2303: An error because something does not exist |
59
|
|
|
|
|
|
|
EFFECTIVE_REGISTRAR_DOES_NOT_EXIST => 2303, |
60
|
|
|
|
|
|
|
HANDLE_DOES_NOT_EXIST => 2303, |
61
|
|
|
|
|
|
|
JOB_UNKNOWN => 2303, |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
# 2304: error due to object status |
64
|
|
|
|
|
|
|
ALLOWED_2LD_FOR_REGISTRAR => 2304, |
65
|
|
|
|
|
|
|
CANCELLED_TRANSFER_WITH_UPDATE => 2304, |
66
|
|
|
|
|
|
|
DOMAIN_INACTIVE => 2304, |
67
|
|
|
|
|
|
|
DOMAIN_IS_NOT_CANCELLED => 2304, |
68
|
|
|
|
|
|
|
DOMAIN_LOCKED => 2304, |
69
|
|
|
|
|
|
|
DOMAIN_WITH_BILL_DAY => 2304, |
70
|
|
|
|
|
|
|
OWNERSHIP_RESTRICTION => 2304, |
71
|
|
|
|
|
|
|
RENEW_NOT_REQUIRED => 2304, |
72
|
|
|
|
|
|
|
TRANSFER_WITHIN_GRACE_PERIOD => 2304, |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
# 2305: association prevents operation |
75
|
|
|
|
|
|
|
HANDLE_IN_USE => 2305, |
76
|
|
|
|
|
|
|
REMOVING_REGISTRAR_ROLE => 2305, |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
# 2306: value error, invalid input |
79
|
|
|
|
|
|
|
ACTION_ID_ALREADY_USED => 2306, |
80
|
|
|
|
|
|
|
BILLED_UNTIL_IN_PAST => 2306, |
81
|
|
|
|
|
|
|
BILLED_UNTIL_TOO_FAR_IN_FUTURE => 2306, |
82
|
|
|
|
|
|
|
FINAL_RUNTIME_BEFORE_FIRST_RUNTIME => 2306, |
83
|
|
|
|
|
|
|
FIRST_RUNTIME_PAST => 2306, |
84
|
|
|
|
|
|
|
FREQUENCY_TOO_SMALL => 2306, |
85
|
|
|
|
|
|
|
HANDLE_ID_WITH_CONTACT_FIELDS => 2306, |
86
|
|
|
|
|
|
|
IDN_DOMAINNAME_MISMATCH => 2306, |
87
|
|
|
|
|
|
|
IDN_INVALID_CHARACTER => 2306, |
88
|
|
|
|
|
|
|
IDN_INVALID_DOMAINNAME => 2306, |
89
|
|
|
|
|
|
|
IDN_INVALID_UNICODE => 2306, |
90
|
|
|
|
|
|
|
IDN_MALFORMED_DOMAINNAME => 2306, |
91
|
|
|
|
|
|
|
IDN_UNDEFINED_UNICODE => 2306, |
92
|
|
|
|
|
|
|
IDN_UNICODE_MISMATCH => 2306, |
93
|
|
|
|
|
|
|
INSUFFICIENT_TERM_FOR_RENEW => 2306, |
94
|
|
|
|
|
|
|
INVALID_ADDRESS => 2306, |
95
|
|
|
|
|
|
|
INVALID_ADDRESS_FILTER => 2306, |
96
|
|
|
|
|
|
|
INVALID_CCTLD => 2306, |
97
|
|
|
|
|
|
|
INVALID_DATE_RANGE => 2306, |
98
|
|
|
|
|
|
|
INVALID_EFFECTIVE_REGISTRAR_ID_IN_CreateRegistrar => 2306, |
99
|
|
|
|
|
|
|
INVALID_EXPLICIT_REGISTRAR_ID => 2306, |
100
|
|
|
|
|
|
|
INVALID_PASSWORD => 2306, |
101
|
|
|
|
|
|
|
INVALID_REGISTRAR_ID_FILTER => 2306, |
102
|
|
|
|
|
|
|
INVALID_WILDCARD_IN_DOMAINNAMEFILTER => 2306, |
103
|
|
|
|
|
|
|
IP4ADDR_NOT_ALLOWED => 2306, |
104
|
|
|
|
|
|
|
IP6ADDR_NOT_ALLOWED => 2306, |
105
|
|
|
|
|
|
|
MISSING_MANDATORY_FIELD => 2306, |
106
|
|
|
|
|
|
|
MULTIPLE_VALUE_IN_FIELD => 2306, |
107
|
|
|
|
|
|
|
NAME_SERVER_DUPLICATION => 2306, |
108
|
|
|
|
|
|
|
NAMESERVERS_EXCEEDED_MAX => 2306, |
109
|
|
|
|
|
|
|
NUMBER_OF_FILTERS_EXCEEDS_MAX => 2306, |
110
|
|
|
|
|
|
|
PAST_EFFECTIVE_DATE => 2306, |
111
|
|
|
|
|
|
|
RENEWAL_EXCEEDS_MAX => 2306, |
112
|
|
|
|
|
|
|
RENEW_REQUIRES_TERM => 2306, |
113
|
|
|
|
|
|
|
RUNLOG_QRY_PARAM_WITHOUT_PROCESS => 2306, |
114
|
|
|
|
|
|
|
SELF_SERVING_DNS_VIOLATION => 2306, |
115
|
|
|
|
|
|
|
TERM_EXCEEDS_MAX => 2306, |
116
|
|
|
|
|
|
|
UNDEFINED_VALUE => 2306, |
117
|
|
|
|
|
|
|
ZERO_TERM_RENEW => 2306, |
118
|
|
|
|
|
|
|
INVALID_FIELD => 2306, |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
# 2308: policy violation. |
121
|
|
|
|
|
|
|
DOMAIN_BLOCKED => 2308, |
122
|
|
|
|
|
|
|
DOUBLE_CANCEL_ATTEMPT => 2308, |
123
|
|
|
|
|
|
|
HANDLE_ID_ON_REGISTRAR_CREATE => 2308, |
124
|
|
|
|
|
|
|
IDN_NOT_ALLOWED => 2308, |
125
|
|
|
|
|
|
|
MULTIPLE_DOMAIN_TRANSFER => 2308, |
126
|
|
|
|
|
|
|
REGISTRY_MUST_BE_EFFECTIVE_REGISTRAR => 2308, |
127
|
|
|
|
|
|
|
REGISTRY_MUST_NOT_BE_EFFECTIVE_REGISTRAR => 2308, |
128
|
|
|
|
|
|
|
DNSSEC_2LD_NOT_ALLOWED => 2308, |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
# 2400: errors that do not stop the connection |
131
|
|
|
|
|
|
|
CONSENT_ERROR => 2400, |
132
|
|
|
|
|
|
|
INCORRECT_EFFECTIVE_REGISTRAR => 2400, |
133
|
|
|
|
|
|
|
INSECURE_UPDATE => 2400, |
134
|
|
|
|
|
|
|
INVALID_EFFECTIVE_REGISTRAR => 2400, |
135
|
|
|
|
|
|
|
LOCK_ERROR => 2400, |
136
|
|
|
|
|
|
|
MESSAGE_TOO_LARGE => 2400, |
137
|
|
|
|
|
|
|
NO_ACTION => 2400, |
138
|
|
|
|
|
|
|
NO_MESSAGE_FILTER_VALUES => 2400, |
139
|
|
|
|
|
|
|
REQUEST_TOO_LONG => 2400, |
140
|
|
|
|
|
|
|
UNEXPECTED_FIELD => 2400, |
141
|
|
|
|
|
|
|
UNKNOWN_TRANSACTION_TYPE => 2400, |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
# 2500: these errors are more serious, something is badly |
144
|
|
|
|
|
|
|
# wrong and hanging up is a good thing to do. |
145
|
|
|
|
|
|
|
CONCURRENT_ACK => 2500, |
146
|
|
|
|
|
|
|
EXTRA_POST_PARAMETERS => 2500, |
147
|
|
|
|
|
|
|
INTERNAL_ERROR => 2500, |
148
|
|
|
|
|
|
|
MISSING_POST_PARAMETERS => 2500, |
149
|
|
|
|
|
|
|
SYSTEM_ERROR => 2500, |
150
|
|
|
|
|
|
|
SYSTEM_MAINTENANCE => 2500, |
151
|
|
|
|
|
|
|
SYSTEM_MIGRATION => 2500, |
152
|
|
|
|
|
|
|
SYSTEM_OFFLINE => 2500, |
153
|
|
|
|
|
|
|
SYSTEM_READONLY => 2500, |
154
|
|
|
|
|
|
|
UNDETERMINED_RESULT => 2500, |
155
|
|
|
|
|
|
|
VERMAJOR_TOO_HIGH => 2500, |
156
|
|
|
|
|
|
|
WRONG_MIME_TYPE => 2500, |
157
|
|
|
|
|
|
|
XML_PARSE_ERROR => 2500, |
158
|
|
|
|
|
|
|
SYSTEM_ERROR => 2500, |
159
|
|
|
|
|
|
|
|
160
|
1
|
|
|
1
|
|
742
|
}; |
|
1
|
|
|
|
|
2
|
|
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
# if the specific error is not found in the above table, we can use |
163
|
|
|
|
|
|
|
# the hint field. |
164
|
|
|
|
|
|
|
|
165
|
1
|
|
|
|
|
62
|
use constant HINT_CODE_FALLBACK => { |
166
|
|
|
|
|
|
|
MALFORMED_REQUEST_ERROR => 2306, |
167
|
|
|
|
|
|
|
INVALID_REQUEST_ERROR => 2308, |
168
|
|
|
|
|
|
|
TEMPORARY_SERVER_ERROR => 2500, |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
#UNKNOWN_RESULT => 2400, |
171
|
|
|
|
|
|
|
#APPLICATION_ERROR => 2400, |
172
|
|
|
|
|
|
|
#UNKNOWN_ERROR_HINT => 2400, |
173
|
1
|
|
|
1
|
|
6
|
}; |
|
1
|
|
|
|
|
2
|
|
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
# a bit weaker still, very urgent errors may as well hang up. |
176
|
1
|
|
|
|
|
237
|
use constant SEVERITY_FALLBACK => { |
177
|
|
|
|
|
|
|
alert => 2500, |
178
|
|
|
|
|
|
|
crit => 2500, |
179
|
|
|
|
|
|
|
err => 2400, |
180
|
1
|
|
|
1
|
|
11
|
}; |
|
1
|
|
|
|
|
3
|
|
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
sub map_srs_error_code { |
183
|
0
|
|
|
0
|
0
|
|
my $srs_error = shift; |
184
|
0
|
0
|
0
|
|
|
|
ERROR_MAP->{$srs_error->error_id} || |
|
|
|
0
|
|
|
|
|
185
|
|
|
|
|
|
|
HINT_CODE_FALLBACK->{$srs_error->hint} || |
186
|
|
|
|
|
|
|
SEVERITY_FALLBACK->{$srs_error->severity} || |
187
|
|
|
|
|
|
|
2400; |
188
|
|
|
|
|
|
|
} |
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
sub map_srs_error { |
191
|
0
|
|
|
0
|
0
|
|
my $srs_error = shift; |
192
|
|
|
|
|
|
|
|
193
|
0
|
|
|
|
|
|
my @details = $srs_error->named_details; |
194
|
0
|
|
|
|
|
|
my @errors; |
195
|
0
|
|
|
|
|
|
while ( my ($name, $value) = splice @details, 0, 2 ) { |
196
|
0
|
|
|
|
|
|
push @errors, XML::EPP::Error->new( |
197
|
|
|
|
|
|
|
value => $value, |
198
|
|
|
|
|
|
|
reason => $name, |
199
|
|
|
|
|
|
|
); |
200
|
|
|
|
|
|
|
} |
201
|
|
|
|
|
|
|
|
202
|
0
|
|
|
|
|
|
@errors; |
203
|
|
|
|
|
|
|
} |
204
|
|
|
|
|
|
|
|
205
|
|
|
|
|
|
|
1; |