fix: correct HTTP codes for Bad Request

This commit is contained in:
Maël Gangloff
2025-10-07 16:33:27 +02:00
parent ea1df9d97a
commit f2c52eded1
3 changed files with 12 additions and 4 deletions

View File

@@ -224,6 +224,9 @@ class RDAPService
$tldEntity = $this->tldRepository->findOneBy(['tld' => $tld]);
if (null === $tldEntity) {
$this->logger->warning('Domain name cannot be updated because the TLD is not supported', [
'ldhName' => $domain,
]);
throw TldNotSupportedException::fromTld($domain);
}
@@ -244,6 +247,10 @@ class RDAPService
$rdapServer = $this->rdapServerRepository->findOneBy(['tld' => $tldString], ['updatedAt' => 'DESC']);
if (null === $rdapServer) {
$this->logger->warning('Unable to determine which RDAP server to contact', [
'tld' => $tldString,
]);
throw UnknownRdapServerException::fromTld($tldString);
}