Skip to content

Commit db9fc32

Browse files
authored
Change EPP errors 2306->2005 for some structural issues (#2911)
2306 signifies something that is syntactically valid but semantically invalid (like if someone tried to register a .com domain). These errors are for domain syntax that could never be valid, thus we should throw a syntax exception instead of a policy exception.
1 parent 84491fd commit db9fc32

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

core/src/main/java/google/registry/flows/domain/DomainFlowUtils.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,49 +1240,49 @@ public LinkedResourceInPendingDeleteProhibitsOperationException(String resourceI
12401240
}
12411241

12421242
/** Domain names can only contain a-z, 0-9, '.' and '-'. */
1243-
static class BadDomainNameCharacterException extends ParameterValuePolicyErrorException {
1243+
static class BadDomainNameCharacterException extends ParameterValueSyntaxErrorException {
12441244
public BadDomainNameCharacterException() {
12451245
super("Domain names can only contain a-z, 0-9, '.' and '-'");
12461246
}
12471247
}
12481248

12491249
/** Non-IDN domain names cannot contain hyphens in the third or fourth position. */
1250-
static class DashesInThirdAndFourthException extends ParameterValuePolicyErrorException {
1250+
static class DashesInThirdAndFourthException extends ParameterValueSyntaxErrorException {
12511251
public DashesInThirdAndFourthException() {
12521252
super("Non-IDN domain names cannot contain dashes in the third or fourth position");
12531253
}
12541254
}
12551255

12561256
/** Domain labels cannot begin with a dash. */
1257-
static class LeadingDashException extends ParameterValuePolicyErrorException {
1257+
static class LeadingDashException extends ParameterValueSyntaxErrorException {
12581258
public LeadingDashException() {
12591259
super("Domain labels cannot begin with a dash");
12601260
}
12611261
}
12621262

12631263
/** Domain labels cannot end with a dash. */
1264-
static class TrailingDashException extends ParameterValuePolicyErrorException {
1264+
static class TrailingDashException extends ParameterValueSyntaxErrorException {
12651265
public TrailingDashException() {
12661266
super("Domain labels cannot end with a dash");
12671267
}
12681268
}
12691269

12701270
/** Domain labels cannot be longer than 63 characters. */
1271-
static class DomainLabelTooLongException extends ParameterValuePolicyErrorException {
1271+
static class DomainLabelTooLongException extends ParameterValueSyntaxErrorException {
12721272
public DomainLabelTooLongException() {
12731273
super("Domain labels cannot be longer than 63 characters");
12741274
}
12751275
}
12761276

12771277
/** No part of a domain name can be empty. */
1278-
static class EmptyDomainNamePartException extends ParameterValuePolicyErrorException {
1278+
static class EmptyDomainNamePartException extends ParameterValueSyntaxErrorException {
12791279
public EmptyDomainNamePartException() {
12801280
super("No part of a domain name can be empty");
12811281
}
12821282
}
12831283

12841284
/** Domain name starts with xn-- but is not a valid IDN. */
1285-
static class InvalidPunycodeException extends ParameterValuePolicyErrorException {
1285+
static class InvalidPunycodeException extends ParameterValueSyntaxErrorException {
12861286
public InvalidPunycodeException() {
12871287
super("Domain name starts with xn-- but is not a valid IDN");
12881288
}

0 commit comments

Comments
 (0)