|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace Lc\SovBundle\Controller; |
|
|
namespace Lc\SovBundle\Controller; |
|
|
|
|
|
|
|
|
|
|
|
use Symfony\Component\ErrorHandler\Exception\FlattenException; |
|
|
use Symfony\Component\HttpFoundation\Request; |
|
|
use Symfony\Component\HttpFoundation\Request; |
|
|
use Symfony\Component\Mailer\MailerInterface; |
|
|
use Symfony\Component\Mailer\MailerInterface; |
|
|
use Throwable; |
|
|
use Throwable; |
|
|
|
|
|
|
|
|
class ErrorController extends AbstractController |
|
|
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 |
|
|
//Si != de 404 on envoit un mail de debug |
|
|
if ($exception->getStatusCode() != 404) { |
|
|
if ($exception->getStatusCode() != 404) { |
|
|
$mailDebug = $this->getParameter('app.mail_debug'); |
|
|
$mailDebug = $this->getParameter('app.mail_debug'); |
|
|
if ($mailDebug) { |
|
|
if ($mailDebug) { |
|
|
$message = "Code : " . $exception->getStatusCode() . "<br>"; |
|
|
|
|
|
|
|
|
$message = "URL : " . $request->getUri() . "<br>"; |
|
|
|
|
|
$message .= "Code : " . $exception->getStatusCode() . "<br>"; |
|
|
$message .= "Message : " . $exception->getMessage() . "<br>"; |
|
|
$message .= "Message : " . $exception->getMessage() . "<br>"; |
|
|
$message .= "File : " . $exception->getFile() . "<br>"; |
|
|
$message .= "File : " . $exception->getFile() . "<br>"; |
|
|
$message .= "Line : " . $exception->getLine() . "<br><br>"; |
|
|
$message .= "Line : " . $exception->getLine() . "<br><br>"; |