Skip to content

Commit

Permalink
fix: http message error
Browse files Browse the repository at this point in the history
  • Loading branch information
maelgangloff committed Aug 7, 2024
1 parent 7902bfb commit a0d2639
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Config/Connector/GandiConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function orderDomain(Domain $domain, bool $dryRun = false): void

if ((!$dryRun && Response::HTTP_ACCEPTED !== $res->getStatusCode())
|| ($dryRun && Response::HTTP_OK !== $res->getStatusCode())) {
throw new \Exception($res->toArray()['message']);
throw new \HttpException($res->toArray()['message']);
}
}

Expand Down
8 changes: 5 additions & 3 deletions src/Service/RDAPService.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Exception\ORMException;
use Psr\Log\LoggerInterface;
use Symfony\Component\HttpClient\Exception\ClientException;
use Symfony\Component\HttpFoundation\Exception\BadRequestException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Contracts\HttpClient\Exception\ClientExceptionInterface;
Expand Down Expand Up @@ -125,9 +126,10 @@ public function registerDomains(array $domains): void

/**
* @throws TransportExceptionInterface
* @throws ServerExceptionInterface
* @throws RedirectionExceptionInterface
* @throws DecodingExceptionInterface
* @throws HttpExceptionInterface
* @throws \Exception
* @throws ClientExceptionInterface
*/
public function registerDomain(string $fqdn): Domain
{
Expand Down Expand Up @@ -160,7 +162,7 @@ public function registerDomain(string $fqdn): Domain
$res = $this->client->request(
'GET', $rdapServerUrl.'domain/'.$idnDomain
)->toArray();
} catch (HttpExceptionInterface $e) {
} catch (ClientException $e) {
if (null !== $domain) {
$this->logger->notice('The domain name {idnDomain} has been deleted from the WHOIS database.', [
'idnDomain' => $idnDomain,
Expand Down

0 comments on commit a0d2639

Please sign in to comment.