8000 Add exception as HTML comment to beginning and end of `exception_full… · symfony/symfony@9639946 · GitHub
[go: up one dir, main page]

Skip to content 10000

Commit 9639946

Browse files
committed
Add exception as HTML comment to beginning and end of exception_full.html.twig
Every now and then you are confronted with an exception in Symfony's debug mode. Sometimes, you will see this in your browser console or terminal. To make it easier to easily see what's going on, this change adds a HTML comment on 2 locations: - between the `<html>` and `<head>` tag; - between the `</body>` and `</html>` tag. This way, you don't have to scan the very verbose HTML that Symfony generates. You can quickly glance at the end or the beginning.
1 parent 519ba3c commit 9639946

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

src/Symfony/Bundle/TwigBundle/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG
22
=========
33

4+
4.3.0
5+
-----
6+
7+
* added HTML comment to beginning and end of `exception_full.html.twig`
8+
49
4.2.0
510
-----
611

src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception_full.html.twig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,14 @@
137137
{{ exception.message }} ({{ status_code }} {{ status_text }})
138138
{% endblock %}
139139

140+
{% block after_head_charset %}
141+
<!-- {{ exception.message }} ({{ status_code }} {{ status_text }}) -->
142+
{% endblock %}
143+
144+
{% block after_body %}
145+
<!-- {{ exception.message }} ({{ status_code }} {{ status_text }}) -->
146+
{% endblock %}
147+
140148
{% block body %}
141149
{% include '@Twig/Exception/exception.html.twig' %}
142150
{% endblock %}

src/Symfony/Bundle/TwigBundle/Resources/views/layout.html.twig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<html>
33
<head>
44
<meta charset="{{ _charset }}" />
5+
{% block after_head_charset %}{% endblock %}
56
<meta name="robots" content="noindex,nofollow" />
67
<meta name="viewport" content="width=device-width,initial-scale=1" />
78
<title>{% block title %}{% endblock %}</title>
@@ -33,4 +34,5 @@
3334
{% block body %}{% endblock %}
3435
{{ include('@Twig/base_js.html.twig') }}
3536
</body>
37+
{% block after_body %}{% endblock %}
3638
</html>

0 commit comments

Comments
 (0)
0