Skip to content
This repository was archived by the owner on May 3, 2023. It is now read-only.

Commit a2919d3

Browse files
committed
Add error page
1 parent 3d88fc8 commit a2919d3

File tree

8 files changed

+51
-21
lines changed

8 files changed

+51
-21
lines changed

config/packages/framework.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ framework:
1616
#fragments: true
1717
php_errors:
1818
log: true
19+

src/Infrastructure/Controller/SingleSignOnReturnController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ public function __invoke(): Response
6060
return $this->ssoAuthenticationReturnAction();
6161
}
6262
} catch (RuntimeException $e) {
63-
return $this->render('default/unrecoverableError.html.twig', [
64-
'message' => $e->getMessage(),
65-
], new Response('', Response::HTTP_NOT_ACCEPTABLE));
63+
$this->logger->alert('Unable to handle return action: ' . $e->getMessage());
64+
65+
throw $e;
6666
}
6767

6868
throw new UnrecoverableErrorException('Application state invalid');
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{% set page_title = 'readid.error.title'|trans %}
2+
{% set intro = 'readid.error_message_intro'|trans ~ logs %}
3+
{% set title = 'readid.error.title'|trans %}
4+
5+
{% extends 'base.html.twig' %}
6+
7+
{% block page_title %}{% endblock %}
8+
9+
{% block body %}
10+
{% include('partial/error.html.twig') %}
11+
{% endblock %}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{% set page_title = 'readid.page_not_found.title'|trans %}
2+
{% set intro = 'readid.page_not_found_intro'|trans ~ logs %}
3+
{% set title = 'readid.page_not_found.title'|trans %}
4+
5+
{% extends 'base.html.twig' %}
6+
7+
{% block page_title %}{% endblock %}
8+
9+
{% block body %}
10+
{% include('partial/error.html.twig') %}
11+
{% endblock %}

templates/default/unrecoverableError.html.twig

Lines changed: 0 additions & 15 deletions
This file was deleted.

templates/partial/error.html.twig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<div class="d-flex flex-column-reverse flex-lg-row align-content-center">
2+
<div class="p-2">
3+
<h2>{{ title }}</h2>
4+
{% if intro is not null %}
5+
<p>
6+
{{ intro }}
7+
</p>
8+
{% endif %}
9+
{% if message is not null %}
10+
<p>
11+
{{ message }}
12+
</p>
13+
{% endif %}
14+
</div>
15+
</div>

translations/messages.en.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
readid.unrecoverable_error: Unrecoverable error
2-
readid.unrecoverable_error_message_intro: Unrecoverable error
3-
readid.unrecoverable_error.title: Unrecoverable error
1+
readid.error.title: 'Oops, something went wrong'
2+
readid.error_message_intro: 'Sorry, something went wrong, please try again.'
3+
site_title: ReadID
4+
readid.page_not_found.title: 'Page not found'
5+
readid.page_not_found_intro: 'The requested page does not exists'

translations/messages.nl.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
readid.error.title: 'Sorry, er ging iets mis'
2+
readid.error_message_intro: 'Er is iets mis gegaan, probeer het opnieuw'
3+
site_title: ReadID
4+
readid.page_not_found.title: 'Page niet gevonden'
5+
readid.page_not_found_intro: 'De opgevraagde pagina bestaat niet'

0 commit comments

Comments
 (0)