Pārlūkot izejas kodu

Merge branch 'develop' of https://forge.laclic.fr/Laclic/SovBundle into develop

feature/symfony6.1
Fabien Normand pirms 3 gadiem
vecāks
revīzija
81ccad2039
1 mainītis faili ar 9 papildinājumiem un 3 dzēšanām
  1. +9
    -3
      Controller/ErrorController.php

+ 9
- 3
Controller/ErrorController.php Parādīt failu

@@ -2,6 +2,7 @@

namespace Lc\SovBundle\Controller;

use Symfony\Component\ErrorHandler\Exception\FlattenException;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Mailer\MailerInterface;
use Throwable;
@@ -11,13 +12,18 @@ use Symfony\Component\Mime\Email;
class ErrorController extends AbstractController
{

public function show($exception, DebugLoggerInterface $logger = null, MailerInterface $mailer)
{
public function show(
Request $request,
FlattenException $exception,
DebugLoggerInterface $logger = null,
MailerInterface $mailer
) {
//Si != de 404 on envoit un mail de debug
if ($exception->getStatusCode() != 404) {
$mailDebug = $this->getParameter('app.mail_debug');
if ($mailDebug) {
$message = "Code : " . $exception->getStatusCode() . "<br>";
$message = "URL : " . $request->getUri() . "<br>";
$message .= "Code : " . $exception->getStatusCode() . "<br>";
$message .= "Message : " . $exception->getMessage() . "<br>";
$message .= "File : " . $exception->getFile() . "<br>";
$message .= "Line : " . $exception->getLine() . "<br><br>";

Notiek ielāde…
Atcelt
Saglabāt