hydra-sql/src/Controller/CustomErrorController.php
rudy a83e8d07ef
All checks were successful
Cadoles/hydra-sql/pipeline/pr-develop This commit looks good
Cadoles/hydra-sql/pipeline/head This commit looks good
issue-12: implémentation redis pour la gestion des session
2023-06-12 15:26:56 +02:00

23 lines
634 B
PHP

<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\ErrorHandler\Exception\FlattenException;
use Symfony\Component\Routing\Annotation\Route;
class CustomErrorController extends AbstractController
{
#[Route(path: '/error', name: 'custom_error_controller')]
public function show(FlattenException $exception)
{
$statusCode = $exception->getStatusCode();
$message = $exception->getMessage();
return $this->render('error.html.twig', [
'statusCode' => $statusCode,
'message' => $message,
]);
}
}