-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Redesigned the exception pages #20951
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
5761b94
5517734
9a5689b
afe4858
561c78d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{% include '@Twig/Exception/error.xml.twig' %} | ||
{{ include('@Twig/Exception/error.xml.twig') }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{% include '@Twig/Exception/error.xml.twig' %} | ||
{{ include('@Twig/Exception/error.xml.twig') }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{% include '@Twig/Exception/exception.xml.twig' with { 'exception': exception } %} | ||
{{ include('@Twig/Exception/exception.xml.twig', { exception: exception }) }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
/* | ||
{% include '@Twig/Exception/exception.txt.twig' with { 'exception': exception } %} | ||
{{ include('@Twig/Exception/exception.txt.twig', { exception: exception }) }} | ||
*/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,120 +1,93 @@ | ||
<div class="block-exception"> | ||
<div class="block-exception-detected clear-fix"> | ||
<div class="support"> | ||
<a href="http://symfony.com/support">Need support?</a> | ||
</div> | ||
<div class="illustration-exception"> | ||
{{ include('@Twig/Exception/exception.svg') }} | ||
<div class="exception-summary"> | ||
<div class="exception-metadata"> | ||
<div class="container"> | ||
<h2 class="exception-hierarchy"> | ||
{{ exception.class|abbr_class }} | ||
{% for previousException in exception.allPrevious %} | ||
<span class="icon">{{ block('icon_chevron_left', '@Twig/Exception/_images.twig') }}</span> | ||
{{ previousException.class|abbr_class }} | ||
{% endfor %} | ||
</h2> | ||
<h2 class="exception-http"> | ||
<small>HTTP</small> <strong>{{ status_code }}</strong> {{ status_text }} | ||
</h2> | ||
</div> | ||
<div class="text-exception"> | ||
<div class="open-quote">“</div> | ||
|
||
<h1>{{ exception.message|nl2br|format_file_from_text }}</h1> | ||
|
||
<div> | ||
<strong>{{ status_code }}</strong> {{ status_text }} - {{ exception.class|abbr_class }} | ||
</div> | ||
<div class="container"> | ||
<div class="exception-message-wrapper"> | ||
<h1 class="break-long-words exception-message"> | ||
{{- exception.message|nl2br|format_file_from_text -}} | ||
</h1> | ||
|
||
<div class="exception-illustration hidden-xs-down"> | ||
{{ block('symfony_ghost', '@Twig/Exception/_images.twig') }} | ||
</div> | ||
|
||
{% set previous_count = exception.allPrevious|length %} | ||
{% if previous_count %} | ||
<div class="linked"><span><strong>{{ previous_count }}</strong> linked Exception{{ previous_count > 1 ? 's' : '' }}:</span> | ||
<ul> | ||
{% for i, previous in exception.allPrevious %} | ||
<li> | ||
{{ previous.class|abbr_class }} <a href="#traces-link-{{ i + 1 }}" onclick="toggle('traces-{{ i + 1 }}', 'traces'); switchIcons('icon-traces-{{ i + 1 }}-open', 'icon-traces-{{ i + 1 }}-close');">»</a> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
</div> | ||
{% endif %} | ||
|
||
<div class="close-quote">”</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
{% for position, e in exception.toarray %} | ||
{% include '@Twig/Exception/traces.html.twig' with { 'exception': e, 'position': position, 'count': previous_count } only %} | ||
{% endfor %} | ||
|
||
{% if logger %} | ||
<div class="block"> | ||
<div class="logs clear-fix"> | ||
{% spaceless %} | ||
<h2> | ||
Logs | ||
<a href="#" onclick="toggle('logs'); switchIcons('icon-logs-open', 'icon-logs-close'); return false;"> | ||
<img class="toggle" id="icon-logs-open" alt="+" src="data:image/gif;base64,R0lGODlhEgASAMQTANft99/v+Ga44bHb8ITG52S44dXs9+z1+uPx+YvK6WC24G+944/M6W28443L6dnu+Ge54v/+/l614P///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAABMALAAAAAASABIAQAVS4DQBTiOd6LkwgJgeUSzHSDoNaZ4PU6FLgYBA5/vFID/DbylRGiNIZu74I0h1hNsVxbNuUV4d9SsZM2EzWe1qThVzwWFOAFCQFa1RQq6DJB4iIQA7" style="display: none" /> | ||
<img class="toggle" id="icon-logs-close" alt="-" src="data:image/gif;base64,R0lGODlhEgASAMQSANft94TG57Hb8GS44ez1+mC24IvK6ePx+Wa44dXs92+942e54o3L6W2844/M6dnu+P/+/l614P///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAABIALAAAAAASABIAQAVCoCQBTBOd6Kk4gJhGBCTPxysJb44K0qD/ER/wlxjmisZkMqBEBW5NHrMZmVKvv9hMVsO+hE0EoNAstEYGxG9heIhCADs=" style="display: inline" /> | ||
</a> | ||
</h2> | ||
{% endspaceless %} | ||
<div class="container"> | ||
<div class="main"> | ||
<div class="sf-tabs"> | ||
<div class="tab"> | ||
{% set exception_as_array = exception.toarray %} | ||
<h3 class="tab-title"> | ||
{% if exception_as_array|length > 1 %} | ||
Exceptions <span class="badge">{{ exception_as_array|length }}</span> | ||
{% else %} | ||
Exception | ||
{% endif %} | ||
</h3> | ||
|
||
<div class="tab-content"> | ||
{% for e in exception_as_array %} | ||
{{ include('@Twig/Exception/traces.html.twig', { exception: e, index: loop.index }, with_context = false) }} | ||
{% endfor %} | ||
</div> | ||
</div> | ||
|
||
{% if logger.counterrors %} | ||
<div class="error-count"> | ||
<span> | ||
{{ logger.counterrors }} error{{ logger.counterrors > 1 ? 's' : ''}} | ||
</span> | ||
</div> | ||
{% endif %} | ||
<div class="tab {{ logger is empty ? 'disabled' }}"> | ||
<h3 class="tab-title"> | ||
Logs | ||
{% if logger.counterrors %}<span class="badge status-error">{{ logger.counterrors }}</span>{% endif %} | ||
</h3> | ||
|
||
<div class="tab-content"> | ||
{% if logger %} | ||
{{ include('@Twig/Exception/logs.html.twig', { logs: logger.logs }, with_context = false) }} | ||
{% else %} | ||
<div class="empty"> | ||
<p>No log messages</p> | ||
</div> | ||
{% endif %} | ||
</div> | ||
</div> | ||
|
||
<div id="logs"> | ||
{% include '@Twig/Exception/logs.html.twig' with { 'logs': logger.logs } only %} | ||
<div class="tab"> | ||
<h3 class="tab-title"> | ||
{% if exception_as_array|length > 1 %} | ||
Stack Traces <span class="badge">{{ exception_as_array|length }}</span> | ||
{% else %} | ||
Stack Trace | ||
{% endif %} | ||
</h3> | ||
|
||
<div class="tab-content"> | ||
{% for e in exception_as_array %} | ||
{{ include('@Twig/Exception/traces_text.html.twig', { exception: e, index: loop.index, num_exceptions: loop.length }, with_context = false) }} | ||
{% endfor %} | ||
</div> | ||
</div> | ||
</div> | ||
{% endif %} | ||
|
||
{% if currentContent %} | ||
<div class="block"> | ||
{% spaceless %} | ||
<h2> | ||
Content of the Output | ||
<a href="#" onclick="toggle('output-content'); switchIcons('icon-content-open', 'icon-content-close'); return false;"> | ||
<img class="toggle" id="icon-content-close" alt="-" src="data:image/gif;base64,R0lGODlhEgASAMQSANft94TG57Hb8GS44ez1+mC24IvK6ePx+Wa44dXs92+942e54o3L6W2844/M6dnu+P/+/l614P///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAABIALAAAAAASABIAQAVCoCQBTBOd6Kk4gJhGBCTPxysJb44K0qD/ER/wlxjmisZkMqBEBW5NHrMZmVKvv9hMVsO+hE0EoNAstEYGxG9heIhCADs=" style="display: none" /> | ||
<img class="toggle" id="icon-content-open" alt="+" src="data:image/gif;base64,R0lGODlhEgASAMQTANft99/v+Ga44bHb8ITG52S44dXs9+z1+uPx+YvK6WC24G+944/M6W28443L6dnu+Ge54v/+/l614P///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAABMALAAAAAASABIAQAVS4DQBTiOd6LkwgJgeUSzHSDoNaZ4PU6FLgYBA5/vFID/DbylRGiNIZu74I0h1hNsVxbNuUV4d9SsZM2EzWe1qThVzwWFOAFCQFa1RQq6DJB4iIQA7" style="display: inline" /> | ||
</a> | ||
</h2> | ||
{% endspaceless %} | ||
{% if currentContent is not empty %} | ||
<div class="tab"> | ||
<h3 class="tab-title">Output content</h3> | ||
|
||
<div id="output-content" style="display: none"> | ||
{{ currentContent }} | ||
<div class="tab-content"> | ||
{{ currentContent }} | ||
</div> | ||
</div> | ||
|
||
<div style="clear: both"></div> | ||
{% endif %} | ||
</div> | ||
{% endif %} | ||
|
||
{% include '@Twig/Exception/traces_text.html.twig' with { 'exception': exception } only %} | ||
|
||
<script type="text/javascript">//<![CDATA[ | ||
function toggle(id, clazz) { | ||
var el = document.getElementById(id), | ||
current = el.style.display, | ||
i; | ||
|
||
if (clazz) { | ||
var tags = document.getElementsByTagName('*'); | ||
for (i = tags.length - 1; i >= 0; i--) { | ||
if (tags[i].className === clazz) { | ||
tags[i].style.display = 'none'; | ||
} | ||
} | ||
} | ||
|
||
el.style.display = current === 'none' ? 'block' : 'none'; | ||
} | ||
|
||
function switchIcons(id1, id2) { | ||
var icon1, icon2, display1, display2; | ||
|
||
icon1 = document.getElementById(id1); | ||
icon2 = document.getElementById(id2); | ||
|
||
display1 = icon1.style.display; | ||
display2 = icon2.style.display; | ||
|
||
icon1.style.display = display2; | ||
icon2.style.display = display1; | ||
} | ||
//]]></script> | ||
</div> | ||
</div> | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
/* | ||
{% include '@Twig/Exception/exception.txt.twig' with { 'exception': exception } %} | ||
{{ include('@Twig/Exception/exception.txt.twig', { exception: exception }) }} | ||
*/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{% include '@Twig/Exception/exception.xml.twig' with { 'exception': exception } %} | ||
{{ include('@Twig/Exception/exception.xml.twig', { exception: exception }) }} |
This file was deleted.
Original file line number | Diff line number | Diff line change 97AE th> |
---|---|---|
|
@@ -139,4 +139,5 @@ | |
|
||
{% block body %} | ||
{% include '@Twig/Exception/exception.html.twig' %} | ||
{{ include('@WebProfiler/Profiler/base_js.html.twig') }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this makes it impossible to use a debug environment where the WebProfilerBundle is not enabled. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. This |
||
{% endblock %} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,28 @@ | ||
<ol class="traces logs"> | ||
{% set channel_is_defined = (logs|first).channel is defined %} | ||
|
||
<table class="logs"> | ||
<thead> | ||
<tr> | ||
<th>Level</th> | ||
{% if channel_is_defined %}<th>Channel</th>{% endif %} | ||
<th class="full-width">Message</th> | ||
</tr> | ||
</thead> | ||
|
||
<tbody> | ||
{% for log in logs %} | ||
<li{% if log.priority >= 400 %} class="error"{% elseif log.priority >= 300 %} class="warning"{% endif %}> | ||
{{ log.priorityName }} - {{ log.message|format_log_message(log.context) }} | ||
</li> | ||
<tr class="status-{{ log.priority >= 400 ? 'error' : log.priority >= 300 ? 'warning' : 'normal' }}"> | ||
<td class="text-small" nowrap> | ||
<span class="colored text-bold">{{ log.priorityName }}</span> | ||
<span class="text-muted newline">{{ log.timestamp|date('H:i:s') }}</span> | ||
</td> | ||
{% if channel_is_defined %} | ||
<td class="text-small text-bold nowrap"> | ||
{{ log.channel }} | ||
</td> | ||
{% endif %} | ||
<td>{{ log.message }}</td> | ||
</tr> | ||
{% endfor %} | ||
</ol> | ||
</tbody> | ||
</table> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why an empty div ?