refactor: change log level and add exceptions

This commit is contained in:
Maël Gangloff
2025-10-13 13:51:51 +02:00
parent efa56055d0
commit 0af22ff989
36 changed files with 253 additions and 135 deletions

View File

@@ -7,8 +7,8 @@ use ApiPlatform\State\ProcessorInterface;
use App\Config\ConnectorProvider;
use App\Entity\Connector;
use App\Entity\User;
use App\Service\Connector\AbstractProvider;
use App\Service\Connector\EppClientProvider;
use App\Service\Provider\AbstractProvider;
use App\Service\Provider\EppClientProvider;
use Psr\Log\LoggerInterface;
use Symfony\Bundle\SecurityBundle\Security;
use Symfony\Component\DependencyInjection\Attribute\Autowire;

View File

@@ -6,7 +6,7 @@ use ApiPlatform\Metadata\Operation;
use ApiPlatform\State\ProcessorInterface;
use App\Config\ConnectorProvider;
use App\Entity\Connector;
use App\Service\Connector\EppClientProvider;
use App\Service\Provider\EppClientProvider;
use Symfony\Component\DependencyInjection\Attribute\Autowire;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;

View File

@@ -9,7 +9,7 @@ use App\Entity\User;
use App\Entity\WatchList;
use App\Notifier\TestChatNotification;
use App\Service\ChatNotificationService;
use App\Service\Connector\AbstractProvider;
use App\Service\Provider\AbstractProvider;
use Psr\Log\LoggerInterface;
use Symfony\Bundle\SecurityBundle\Security;
use Symfony\Component\DependencyInjection\Attribute\Autowire;
@@ -68,7 +68,7 @@ readonly class WatchListUpdateProcessor implements ProcessorInterface
foreach ($data->getDomains()->getIterator() as $domain) {
if (in_array($domain, $trackedDomains)) {
$ldhName = $domain->getLdhName();
$this->logger->notice('User tried to update a watchlist : it is forbidden to register the same domain name twice with limited mode', [
$this->logger->notice('User tried to update a Watchlist : it is forbidden to register the same domain name twice with limited mode', [
'username' => $user->getUserIdentifier(),
'watchlist' => $data->getToken(),
'ldhName' => $ldhName,
@@ -117,7 +117,7 @@ readonly class WatchListUpdateProcessor implements ProcessorInterface
$supported = $connectorProvider->isSupported(...$data->getDomains()->toArray());
if (!$supported) {
$this->logger->notice('Connector does not support all TLDs in this Watchlist', [
$this->logger->debug('Connector does not support all TLDs in this Watchlist', [
'username' => $user->getUserIdentifier(),
'connector' => $connector->getId(),
'provider' => $connector->getProvider()->value,