mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-17 17:55:42 +00:00
fix: http message error
This commit is contained in:
parent
7902bfbe32
commit
a0d2639311
@ -79,7 +79,7 @@ readonly class GandiConnector implements ConnectorInterface
|
|||||||
|
|
||||||
if ((!$dryRun && Response::HTTP_ACCEPTED !== $res->getStatusCode())
|
if ((!$dryRun && Response::HTTP_ACCEPTED !== $res->getStatusCode())
|
||||||
|| ($dryRun && Response::HTTP_OK !== $res->getStatusCode())) {
|
|| ($dryRun && Response::HTTP_OK !== $res->getStatusCode())) {
|
||||||
throw new \Exception($res->toArray()['message']);
|
throw new \HttpException($res->toArray()['message']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -25,6 +25,7 @@ use App\Repository\TldRepository;
|
|||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\ORM\Exception\ORMException;
|
use Doctrine\ORM\Exception\ORMException;
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
|
use Symfony\Component\HttpClient\Exception\ClientException;
|
||||||
use Symfony\Component\HttpFoundation\Exception\BadRequestException;
|
use Symfony\Component\HttpFoundation\Exception\BadRequestException;
|
||||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||||
use Symfony\Contracts\HttpClient\Exception\ClientExceptionInterface;
|
use Symfony\Contracts\HttpClient\Exception\ClientExceptionInterface;
|
||||||
@ -125,9 +126,10 @@ readonly class RDAPService
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws TransportExceptionInterface
|
* @throws TransportExceptionInterface
|
||||||
|
* @throws ServerExceptionInterface
|
||||||
|
* @throws RedirectionExceptionInterface
|
||||||
* @throws DecodingExceptionInterface
|
* @throws DecodingExceptionInterface
|
||||||
* @throws HttpExceptionInterface
|
* @throws ClientExceptionInterface
|
||||||
* @throws \Exception
|
|
||||||
*/
|
*/
|
||||||
public function registerDomain(string $fqdn): Domain
|
public function registerDomain(string $fqdn): Domain
|
||||||
{
|
{
|
||||||
@ -160,7 +162,7 @@ readonly class RDAPService
|
|||||||
$res = $this->client->request(
|
$res = $this->client->request(
|
||||||
'GET', $rdapServerUrl.'domain/'.$idnDomain
|
'GET', $rdapServerUrl.'domain/'.$idnDomain
|
||||||
)->toArray();
|
)->toArray();
|
||||||
} catch (HttpExceptionInterface $e) {
|
} catch (ClientException $e) {
|
||||||
if (null !== $domain) {
|
if (null !== $domain) {
|
||||||
$this->logger->notice('The domain name {idnDomain} has been deleted from the WHOIS database.', [
|
$this->logger->notice('The domain name {idnDomain} has been deleted from the WHOIS database.', [
|
||||||
'idnDomain' => $idnDomain,
|
'idnDomain' => $idnDomain,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user