exception.html.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <div class="exception-summary <?= !$exceptionMessage ? 'exception-without-message' : ''; ?>">
  2. <div class="exception-metadata">
  3. <div class="container">
  4. <h2 class="exception-hierarchy">
  5. <?php foreach (array_reverse($exception->getAllPrevious(), true) as $index => $previousException) { ?>
  6. <a href="#trace-box-<?= $index + 2; ?>"><?= $this->abbrClass($previousException->getClass()); ?></a>
  7. <span class="icon"><?= $this->include('assets/images/chevron-right.svg'); ?></span>
  8. <?php } ?>
  9. <a href="#trace-box-1"><?= $this->abbrClass($exception->getClass()); ?></a>
  10. </h2>
  11. <h2 class="exception-http">
  12. HTTP <?= $statusCode; ?> <small><?= $statusText; ?></small>
  13. </h2>
  14. </div>
  15. </div>
  16. <div class="exception-message-wrapper">
  17. <div class="container">
  18. <h1 class="break-long-words exception-message<?= mb_strlen($exceptionMessage) > 180 ? ' long' : ''; ?>"><?= $this->formatFileFromText(nl2br($exceptionMessage)); ?></h1>
  19. <div class="exception-illustration hidden-xs-down">
  20. <?= $this->include('assets/images/symfony-ghost.svg.php'); ?>
  21. </div>
  22. </div>
  23. </div>
  24. </div>
  25. <div class="container">
  26. <div class="sf-tabs">
  27. <div class="tab">
  28. <?php
  29. $exceptionAsArray = $exception->toArray();
  30. $exceptionWithUserCode = [];
  31. $exceptionAsArrayCount = count($exceptionAsArray);
  32. $last = $exceptionAsArrayCount - 1;
  33. foreach ($exceptionAsArray as $i => $e) {
  34. foreach ($e['trace'] as $trace) {
  35. if ($trace['file'] && false === mb_strpos($trace['file'], '/vendor/') && false === mb_strpos($trace['file'], '/var/cache/') && $i < $last) {
  36. $exceptionWithUserCode[] = $i;
  37. }
  38. }
  39. }
  40. ?>
  41. <h3 class="tab-title">
  42. <?php if ($exceptionAsArrayCount > 1) { ?>
  43. Exceptions <span class="badge"><?= $exceptionAsArrayCount; ?></span>
  44. <?php } else { ?>
  45. Exception
  46. <?php } ?>
  47. </h3>
  48. <div class="tab-content">
  49. <?php
  50. foreach ($exceptionAsArray as $i => $e) {
  51. echo $this->include('views/traces.html.php', [
  52. 'exception' => $e,
  53. 'index' => $i + 1,
  54. 'expand' => in_array($i, $exceptionWithUserCode, true) || ([] === $exceptionWithUserCode && 0 === $i),
  55. ]);
  56. }
  57. ?>
  58. </div>
  59. </div>
  60. <?php if ($logger) { ?>
  61. <div class="tab <?= !$logger->getLogs() ? 'disabled' : ''; ?>">
  62. <h3 class="tab-title">
  63. Logs
  64. <?php if ($logger->countErrors()) { ?><span class="badge status-error"><?= $logger->countErrors(); ?></span><?php } ?>
  65. </h3>
  66. <div class="tab-content">
  67. <?php if ($logger->getLogs()) { ?>
  68. <?= $this->include('views/logs.html.php', ['logs' => $logger->getLogs()]); ?>
  69. <?php } else { ?>
  70. <div class="empty">
  71. <p>No log messages</p>
  72. </div>
  73. <?php } ?>
  74. </div>
  75. </div>
  76. <?php } ?>
  77. <div class="tab">
  78. <h3 class="tab-title">
  79. <?php if ($exceptionAsArrayCount > 1) { ?>
  80. Stack Traces <span class="badge"><?= $exceptionAsArrayCount; ?></span>
  81. <?php } else { ?>
  82. Stack Trace
  83. <?php } ?>
  84. </h3>
  85. <div class="tab-content">
  86. <?php
  87. foreach ($exceptionAsArray as $i => $e) {
  88. echo $this->include('views/traces_text.html.php', [
  89. 'exception' => $e,
  90. 'index' => $i + 1,
  91. 'numExceptions' => $exceptionAsArrayCount,
  92. ]);
  93. }
  94. ?>
  95. </div>
  96. </div>
  97. <?php if ($currentContent) { ?>
  98. <div class="tab">
  99. <h3 class="tab-title">Output content</h3>
  100. <div class="tab-content">
  101. <?= $currentContent; ?>
  102. </div>
  103. </div>
  104. <?php } ?>
  105. </div>
  106. </div>