exception.html.twig 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <div class="block-exception">
  2. <div class="block-exception-detected clear-fix">
  3. <div class="support">
  4. <a href="http://symfony.com/support">Need support?</a>
  5. </div>
  6. <div class="illustration-exception">
  7. {{ include('@Twig/Exception/exception.svg') }}
  8. </div>
  9. <div class="text-exception">
  10. <div class="open-quote">“</div>
  11. <h1>{{ exception.message|nl2br|format_file_from_text }}</h1>
  12. <div>
  13. <strong>{{ status_code }}</strong> {{ status_text }} - {{ exception.class|abbr_class }}
  14. </div>
  15. {% set previous_count = exception.allPrevious|length %}
  16. {% if previous_count %}
  17. <div class="linked"><span><strong>{{ previous_count }}</strong> linked Exception{{ previous_count > 1 ? 's' : '' }}:</span>
  18. <ul>
  19. {% for i, previous in exception.allPrevious %}
  20. <li>
  21. {{ 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');">&#187;</a>
  22. </li>
  23. {% endfor %}
  24. </ul>
  25. </div>
  26. {% endif %}
  27. <div class="close-quote">”</div>
  28. </div>
  29. </div>
  30. </div>
  31. {% for position, e in exception.toarray %}
  32. {% include '@Twig/Exception/traces.html.twig' with { 'exception': e, 'position': position, 'count': previous_count } only %}
  33. {% endfor %}
  34. {% if logger %}
  35. <div class="block">
  36. <div class="logs clear-fix">
  37. {% spaceless %}
  38. <h2>
  39. Logs&nbsp;
  40. <a href="#" onclick="toggle('logs'); switchIcons('icon-logs-open', 'icon-logs-close'); return false;">
  41. <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" />
  42. <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" />
  43. </a>
  44. </h2>
  45. {% endspaceless %}
  46. {% if logger.counterrors %}
  47. <div class="error-count">
  48. <span>
  49. {{ logger.counterrors }} error{{ logger.counterrors > 1 ? 's' : ''}}
  50. </span>
  51. </div>
  52. {% endif %}
  53. </div>
  54. <div id="logs">
  55. {% include '@Twig/Exception/logs.html.twig' with { 'logs': logger.logs } only %}
  56. </div>
  57. </div>
  58. {% endif %}
  59. {% if currentContent %}
  60. <div class="block">
  61. {% spaceless %}
  62. <h2>
  63. Content of the Output&nbsp;
  64. <a href="#" onclick="toggle('output-content'); switchIcons('icon-content-open', 'icon-content-close'); return false;">
  65. <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" />
  66. <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" />
  67. </a>
  68. </h2>
  69. {% endspaceless %}
  70. <div id="output-content" style="display: none">
  71. {{ currentContent }}
  72. </div>
  73. <div style="clear: both"></div>
  74. </div>
  75. {% endif %}
  76. {% include '@Twig/Exception/traces_text.html.twig' with { 'exception': exception } only %}
  77. <script type="text/javascript">//<![CDATA[
  78. function toggle(id, clazz) {
  79. var el = document.getElementById(id),
  80. current = el.style.display,
  81. i;
  82. if (clazz) {
  83. var tags = document.getElementsByTagName('*');
  84. for (i = tags.length - 1; i >= 0; i--) {
  85. if (tags[i].className === clazz) {
  86. tags[i].style.display = 'none';
  87. }
  88. }
  89. }
  90. el.style.display = current === 'none' ? 'block' : 'none';
  91. }
  92. function switchIcons(id1, id2) {
  93. var icon1, icon2, display1, display2;
  94. icon1 = document.getElementById(id1);
  95. icon2 = document.getElementById(id2);
  96. display1 = icon1.style.display;
  97. display2 = icon2.style.display;
  98. icon1.style.display = display2;
  99. icon2.style.display = display1;
  100. }
  101. //]]></script>