Skip to content

Commit 5c40a9d

Browse files
fix(hexonet): add response translator mapping for invalid domain name; RSRMID-271
1 parent ea92af5 commit 5c40a9d

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/HEXONET/ResponseTranslator.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ class ResponseTranslator
3939
// HX
4040
"Invalid attribute value syntax; resource record \[(.+)\]" => "Invalid Syntax for DNSZone Resource Record: $1",
4141
"Missing required attribute; CLASS(?:=| \[MUST BE )PREMIUM_([\w\+]+)[\s\]]" => "Confirm the Premium pricing by providing the parameter CLASS with the value PREMIUM_$1.",
42+
"Syntax error in Parameter DOMAIN \((.+)\)" => "The Domain Name $1 is invalid."
4243
]
4344
];
4445

tests/HEXONET/ResponseTranslatorTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,5 +167,8 @@ public function testTranslate(): void
167167
// DNS match
168168
$r = RT::translate("[RESPONSE]\r\ncode=505\r\ndescription=Invalid attribute value syntax; resource record [213123 A 1.2.4.5asdfa]\r\nEOF\r\n", []);
169169
$this->assertEquals("[RESPONSE]\r\ncode=505\r\ndescription=Invalid Syntax for DNSZone Resource Record: 213123 A 1.2.4.5asdfa\r\nEOF\r\n", $r);
170+
// invalid DN
171+
$r = RT::translate("[RESPONSE]\r\ncode=505\r\ndescription=Syntax error in Parameter DOMAIN (my–domain.de)\r\nEOF\r\n", []);
172+
$this->assertEquals("[RESPONSE]\r\ncode=505\r\ndescription=The Domain Name my–domain.de is invalid.\r\nEOF\r\n", $r);
170173
}
171174
}

0 commit comments

Comments
 (0)