Browse Source

ajoute l'affichage des erreurs

master
vincent 3 months ago
parent
commit
e16fdd598b
3 changed files with 13 additions and 0 deletions
  1. +1
    -0
      config/packages/framework.yaml
  2. +8
    -0
      src/Controller/HomeController.php
  3. +4
    -0
      templates/home/error.html.twig

+ 1
- 0
config/packages/framework.yaml View File

@ -8,6 +8,7 @@ framework:
#esi: true
#fragments: true
error_controller: App\Controller\HomeController::error
when@test:
framework:


+ 8
- 0
src/Controller/HomeController.php View File

@ -19,6 +19,14 @@ class HomeController extends AbstractController
]);
}
public function error($exception, $logger = null): Response
{
$this->addFlash('danger', 'Erreur ! ' . $exception->getMessage());
return $this->render('home/error.html.twig', [
]);
}
#[Route('/osm/request', name: 'app_osm_request')]
public function osmRequest(ClientRegistry $clientRegistry): Response
{


+ 4
- 0
templates/home/error.html.twig View File

@ -0,0 +1,4 @@
{% extends 'base.html.twig' %}
{% block page_content %}
{% endblock %}

Loading…
Cancel
Save