handle error

This commit is contained in:
Charles 2025-07-16 15:50:45 +02:00
parent 4a2f9d9547
commit 65ff838dd9
2 changed files with 14 additions and 0 deletions

View File

@ -38,6 +38,9 @@ class UserController extends AbstractController
if ($this->isGranted('ROLE_SUDALYS_ADMIN')) {
$userId = $request->attributes->get('id');
$user = $entityManager->getRepository(User::class)->find($userId);
if(!$user) {
throw $this->createNotFoundException('User not found');
}
$userOrganizations = $this->userOrganizationService->getUserOrganizations($user);
}
return $this->render('user/profile.html.twig', [

View File

@ -0,0 +1,11 @@
{% extends 'base.html.twig' %}
{% block title %}Page Not Found (404){% endblock %}
{% block body %}
<div class="d-flex justify-content-center align-items-center vh-100">
<h1>Oops! La page n'existe pas (404)</h1>
<p>La page que vous cherchez n'existe pas.</p>
<a href="{{ path('app_index') }}"> Retour à l'accueil </a>
</div>
{% endblock %}