fix: process domain

This commit is contained in:
Maël Gangloff
2024-08-10 23:06:03 +02:00
parent 880d5b4575
commit d4fcd7fe51
2 changed files with 16 additions and 28 deletions

View File

@@ -165,18 +165,18 @@ readonly class RDAPService
'GET', $rdapServerUrl.'domain/'.$idnDomain
)->toArray();
} catch (\Throwable $e) {
if (null !== $domain) {
$this->logger->notice('The domain name {idnDomain} has been deleted from the WHOIS database.', [
'idnDomain' => $idnDomain,
]);
$domain->setDeleted(true)
->updateTimestamps();
$this->em->persist($domain);
$this->em->flush();
}
if ($e instanceof ClientException && 404 === $e->getResponse()->getStatusCode()) {
if (null !== $domain) {
$this->logger->notice('The domain name {idnDomain} has been deleted from the WHOIS database.', [
'idnDomain' => $idnDomain,
]);
$domain->setDeleted(true)
->updateTimestamps();
$this->em->persist($domain);
$this->em->flush();
}
throw new NotFoundHttpException('The domain name is not present in the WHOIS database.');
}