404.phtml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. // @codingStandardsIgnoreFile
  7. ?>
  8. <header class="header">
  9. <img class="logo" src="<?= $this->basePath() ?>/pub/images/magento-icon.svg" alt="Magento"/>
  10. <h1 class="header-title">A 404 error occurred</h1>
  11. </header>
  12. <h2>Page not found</h2>
  13. <?php if ( isset( $this->reason ) && $this->reason ): ?>
  14. <?php
  15. $reasonMessage = '';
  16. switch ( $this->reason ) {
  17. case 'error-controller-cannot-dispatch':
  18. $reasonMessage = 'The requested controller was unable to dispatch the request.';
  19. break;
  20. case 'error-controller-not-found':
  21. $reasonMessage = 'The requested controller could not be mapped to an existing controller class.';
  22. break;
  23. case 'error-controller-invalid':
  24. $reasonMessage = 'The requested controller was not dispatchable.';
  25. break;
  26. case 'error-router-no-match':
  27. $reasonMessage = 'The requested URL could not be matched by routing.';
  28. break;
  29. default:
  30. $reasonMessage = 'We cannot determine at this time why a 404 was generated.';
  31. break;
  32. }
  33. ?>
  34. <p><?= $reasonMessage ?></p>
  35. <?php endif ?>
  36. <?php if ( isset( $this->controller ) && $this->controller ): ?>
  37. <dl>
  38. <dt>Controller:</dt>
  39. <dd><?= $this->escapeHtml( $this->controller ) ?>
  40. <?php
  41. if ( isset( $this->controller_class )
  42. && $this->controller_class
  43. && $this->controller_class != $this->controller
  44. ) {
  45. echo '(' . sprintf( 'resolves to %s', $this->escapeHtml( $this->controller_class ) ) . ')';
  46. }
  47. ?>
  48. </dd>
  49. </dl>
  50. <?php endif ?>
  51. <?php if ( isset( $this->display_exceptions ) && $this->display_exceptions ): ?>
  52. <?php if ( isset( $this->exception ) && $this->exception instanceof Exception ): ?>
  53. <hr/>
  54. <h2>Additional information:</h2>
  55. <h3><?= get_class( $this->exception ) ?></h3>
  56. <dl>
  57. <dt>File:</dt>
  58. <dd>
  59. <pre class="prettyprint linenums"><?= $this->exception->getFile() ?>:<?= $this->exception->getLine() ?></pre>
  60. </dd>
  61. <dt>Message:</dt>
  62. <dd>
  63. <pre class="prettyprint linenums"><?= $this->exception->getMessage() ?></pre>
  64. </dd>
  65. <dt>Stack trace:</dt>
  66. <dd>
  67. <pre class="prettyprint linenums"><?= $this->exception->getTraceAsString() ?></pre>
  68. </dd>
  69. </dl>
  70. <?php
  71. $e = $this->exception->getPrevious();
  72. if ( $e ) :
  73. ?>
  74. <hr/>
  75. <h2>Previous exceptions:</h2>
  76. <ul class="unstyled">
  77. <?php while ( $e ) : ?>
  78. <li>
  79. <h3><?= get_class( $e ) ?></h3>
  80. <dl>
  81. <dt>File:</dt>
  82. <dd>
  83. <pre class="prettyprint linenums"><?= $e->getFile() ?>:<?= $e->getLine() ?></pre>
  84. </dd>
  85. <dt>Message:</dt>
  86. <dd>
  87. <pre class="prettyprint linenums"><?= $e->getMessage() ?></pre>
  88. </dd>
  89. <dt>Stack trace:</dt>
  90. <dd>
  91. <pre class="prettyprint linenums"><?= $e->getTraceAsString() ?></pre>
  92. </dd>
  93. </dl>
  94. </li>
  95. <?php
  96. $e = $e->getPrevious();
  97. endwhile;
  98. ?>
  99. </ul>
  100. <?php endif; ?>
  101. <?php else: ?>
  102. <p>No Exception available</p>
  103. <?php endif ?>
  104. <?php endif ?>