exception.html.twig 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <div class="sf-exceptionreset">
  2. <div class="block_exception">
  3. <div class="block_exception_detected clear_fix">
  4. <div class="illustration_exception">
  5. <img alt="Exception detected!" src="{{ asset('bundles/framework/images/exception_detected.gif') }}"/>
  6. </div>
  7. <div class="text_exception">
  8. <div class="open_quote">
  9. <img alt="" src="{{ asset('bundles/framework/images/open_quote.gif') }}"/>
  10. </div>
  11. <h1>
  12. {{ exception.message|replace({"\n": '<br />'})|format_file_from_text }}
  13. </h1>
  14. <div>
  15. <strong>{{ status_code }}</strong> {{ status_text }} - {{ exception.class|abbr_class }}
  16. </div>
  17. {% set previous_count = exception.allPrevious|length %}
  18. {% if previous_count|length %}
  19. <div class="linked"><span><strong>{{ previous_count }}</strong> linked Exception{{ previous_count > 1 ? 's' : '' }}:</span>
  20. <ul>
  21. {% for i, previous in exception.allPrevious %}
  22. <li>
  23. {{ 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');">&raquo;</a>
  24. </li>
  25. {% endfor %}
  26. </ul>
  27. </div>
  28. {% endif %}
  29. <div class="close_quote">
  30. <img alt="" src="{{ asset('bundles/framework/images/close_quote.gif') }}"/>
  31. </div>
  32. </div>
  33. </div>
  34. </div>
  35. {% for position, e in exception.toarray %}
  36. {% include 'FrameworkBundle:Exception:traces.html.twig' with { 'exception': e, 'position': position, 'count': previous_count } only %}
  37. {% endfor %}
  38. {% if logger %}
  39. <div class="block">
  40. <div class="logs clear_fix">
  41. {% spaceless %}
  42. <h2>
  43. Logs&nbsp;
  44. <a href="#" onclick="toggle('logs'); switchIcons('icon_logs_open', 'icon_logs_close'); return false;">
  45. <img class="toggle" id="icon_logs_open" alt="+" src="{{ asset('bundles/framework/images/blue_picto_more.gif') }}" style="visibility: hidden" />
  46. <img class="toggle" id="icon_logs_close" alt="-" src="{{ asset('bundles/framework/images/blue_picto_less.gif') }}" style="visibility: display; margin-left: -18px" />
  47. </a>
  48. </h2>
  49. {% endspaceless %}
  50. {% if logger.counterrors %}
  51. <div class="error_count">
  52. <span>
  53. {{ logger.counterrors }} error{{ logger.counterrors > 1 ? 's' : ''}}
  54. </span>
  55. </div>
  56. {% endif %}
  57. </div>
  58. <div id="logs">
  59. {% include 'FrameworkBundle:Exception:logs.html.twig' with { 'logs': logger.logs } only %}
  60. </div>
  61. </div>
  62. {% endif %}
  63. {% if currentContent %}
  64. <div class="block">
  65. {% spaceless %}
  66. <h2>
  67. Content of the Output&nbsp;
  68. <a href="#" onclick="toggle('output_content'); switchIcons('icon_content_open', 'icon_content_close'); return false;">
  69. <img class="toggle" id="icon_content_close" alt="-" src="{{ asset('bundles/framework/images/blue_picto_less.gif') }}" style="visibility: hidden" />
  70. <img class="toggle" id="icon_content_open" alt="+" src="{{ asset('bundles/framework/images/blue_picto_more.gif') }}" style="visibility: display; margin-left: -18px" />
  71. </a>
  72. </h2>
  73. {% endspaceless %}
  74. <div id="output_content" style="display: none">
  75. {{ currentContent }}
  76. </div>
  77. <div style="clear: both"></div>
  78. </div>
  79. {% endif %}
  80. </div>
  81. <script type="text/javascript">//<![CDATA[
  82. function toggle(id, clazz) {
  83. var el = document.getElementById(id),
  84. current = el.style.display,
  85. i;
  86. if (clazz) {
  87. var tags = document.getElementsByTagName('*');
  88. for (i = tags.length - 1; i >= 0 ; i--) {
  89. if (tags[i].className === clazz) {
  90. tags[i].style.display = 'none';
  91. }
  92. }
  93. }
  94. el.style.display = current === 'none' ? 'block' : 'none';
  95. }
  96. function switchIcons(id1, id2) {
  97. var icon1, icon2, visibility1, visibility2;
  98. icon1 = document.getElementById(id1);
  99. icon2 = document.getElementById(id2);
  100. visibility1 = icon1.style.visibility;
  101. visibility2 = icon2.style.visibility;
  102. icon1.style.visibility = visibility2;
  103. icon2.style.visibility = visibility1;
  104. }
  105. //]]></script>