handle error
This commit is contained in:
parent
4a2f9d9547
commit
65ff838dd9
|
|
@ -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', [
|
||||
|
|
|
|||
|
|
@ -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 %}
|
||||
Loading…
Reference in New Issue