mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-17 17:55:42 +00:00
fix: catch libcurl unexpected EOF while reading exception
This commit is contained in:
parent
1b1b82189e
commit
6af1e2661b
@ -24,11 +24,11 @@ class IcannAccreditation
|
|||||||
private ?RegistrarStatus $status = null;
|
private ?RegistrarStatus $status = null;
|
||||||
|
|
||||||
#[ORM\Column(type: Types::DATE_IMMUTABLE, nullable: true)]
|
#[ORM\Column(type: Types::DATE_IMMUTABLE, nullable: true)]
|
||||||
#[Groups(['entity:item', 'domain:item'])]
|
#[Groups(['entity:item', 'entity:list', 'domain:item'])]
|
||||||
private ?\DateTimeImmutable $updated = null;
|
private ?\DateTimeImmutable $updated = null;
|
||||||
|
|
||||||
#[ORM\Column(type: Types::DATE_IMMUTABLE, nullable: true)]
|
#[ORM\Column(type: Types::DATE_IMMUTABLE, nullable: true)]
|
||||||
#[Groups(['entity:item', 'domain:item'])]
|
#[Groups(['entity:item', 'entity:list', 'domain:item'])]
|
||||||
private ?\DateTimeImmutable $date = null;
|
private ?\DateTimeImmutable $date = null;
|
||||||
|
|
||||||
public function getRegistrarName(): ?string
|
public function getRegistrarName(): ?string
|
||||||
|
|||||||
@ -43,6 +43,7 @@ use Symfony\Contracts\HttpClient\Exception\RedirectionExceptionInterface;
|
|||||||
use Symfony\Contracts\HttpClient\Exception\ServerExceptionInterface;
|
use Symfony\Contracts\HttpClient\Exception\ServerExceptionInterface;
|
||||||
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
|
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
|
||||||
use Symfony\Contracts\HttpClient\HttpClientInterface;
|
use Symfony\Contracts\HttpClient\HttpClientInterface;
|
||||||
|
use Symfony\Contracts\HttpClient\ResponseInterface;
|
||||||
|
|
||||||
class RDAPService
|
class RDAPService
|
||||||
{
|
{
|
||||||
@ -248,7 +249,7 @@ class RDAPService
|
|||||||
|
|
||||||
return $req->toArray();
|
return $req->toArray();
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
throw $this->handleRdapException($e, $idnDomain, $domain);
|
throw $this->handleRdapException($e, $idnDomain, $domain, $req ?? null);
|
||||||
} finally {
|
} finally {
|
||||||
if ($this->influxdbEnabled && isset($req)) {
|
if ($this->influxdbEnabled && isset($req)) {
|
||||||
$this->influxService->addRdapQueryPoint($rdapServer, $idnDomain, $req->getInfo());
|
$this->influxService->addRdapQueryPoint($rdapServer, $idnDomain, $req->getInfo());
|
||||||
@ -260,9 +261,12 @@ class RDAPService
|
|||||||
* @throws TransportExceptionInterface
|
* @throws TransportExceptionInterface
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
*/
|
*/
|
||||||
private function handleRdapException(\Exception $e, string $idnDomain, ?Domain $domain): \Exception
|
private function handleRdapException(\Exception $e, string $idnDomain, ?Domain $domain, ?ResponseInterface $response): \Exception
|
||||||
{
|
{
|
||||||
if ($e instanceof ClientException && 404 === $e->getResponse()->getStatusCode()) {
|
if (
|
||||||
|
($e instanceof ClientException && 404 === $e->getResponse()->getStatusCode())
|
||||||
|
|| ($e instanceof TransportExceptionInterface && null !== $response && !in_array('content-length', $response->getHeaders(false)))
|
||||||
|
) {
|
||||||
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,
|
||||||
|
|||||||
@ -10,6 +10,7 @@
|
|||||||
"strict": true
|
"strict": true
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"node_modules"
|
"node_modules",
|
||||||
|
"vendor/**/*.ts"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user