Skip to content

Commit

Permalink
ignore error 404 for alert email #3101
Browse files Browse the repository at this point in the history
  • Loading branch information
sfinx13 committed Sep 26, 2024
1 parent 779b9ac commit dda8e84
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/EventListener/ExceptionListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Event\ExceptionEvent;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\Routing\Exception\MethodNotAllowedException;
use Symfony\Component\Serializer\Exception\NotEncodableValueException;

Expand Down Expand Up @@ -37,7 +38,7 @@ public function onKernelException(ExceptionEvent $event): void
$event->setResponse($response);
}

if (!$exception instanceof MethodNotAllowedException) {
if (!$exception instanceof MethodNotAllowedException && !$exception instanceof NotFoundHttpException) {
$this->notificationMailerRegistry->send(
new NotificationMail(
type: NotificationMailerType::TYPE_ERROR_SIGNALEMENT,
Expand Down
2 changes: 1 addition & 1 deletion src/Service/Mailer/Mail/Error/ErrorSignalementMailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
class ErrorSignalementMailer extends AbstractNotificationMailer
{
protected ?NotificationMailerType $mailerType = NotificationMailerType::TYPE_ERROR_SIGNALEMENT;
protected ?string $mailerSubject = 'Une erreur est survenue lors de la création d\'un signalement !';
protected ?string $mailerSubject = 'Une erreur est survenue !';
protected ?string $mailerTemplate = 'erreur_signalement_email';

public function __construct(
Expand Down

0 comments on commit dda8e84

Please sign in to comment.