9c8b02949a
Fixes #825 - Changes the way the error middleware is delivered in server.js, moving all the logic back into errorHandling.js - Alters error logging to use console.error (probably more appropriate) instead of console.log - Changes error tests to accomodate for these alterations - Alters user-error and error hbs templates to incorporate stack traces - Adds additional styling for error pages to accomodate stack traces - Added logic to parse and deliver formatted stack traces Notes: ====== - Jslint gets in the way of the regex I've got to use to parse the stack. (It cites 'security reasons' which are not relevant in this case.) I needed to add a condition to relax it at the top of errorHandling.js - The stack trace should probably be added as a partial, but I figured it was out of scope for this PR.
27 lines
980 B
Handlebars
27 lines
980 B
Handlebars
{{!< default}}
|
|
<section class="error-content error-404 js-error-container">
|
|
<section class="error-details">
|
|
<figure class="error-image">
|
|
<img class="error-ghost" src="/ghost/img/404-ghost@2x.png" srcset="/ghost/img/404-ghost.png 1x, /ghost/img/404-ghost@2x.png 2x"/>
|
|
</figure>
|
|
<section class="error-message">
|
|
<h1 class="error-code">{{code}}</h1>
|
|
<h2 class="error-description">{{message}}</h2>
|
|
</section>
|
|
</section>
|
|
</section>
|
|
{{#if stack}}
|
|
<section class="error-stack">
|
|
<h3>Stack Trace</h3>
|
|
<p><strong>{{message}}</strong></p>
|
|
<ul class="error-stack-list">
|
|
{{#foreach stack}}
|
|
<li>
|
|
at
|
|
{{#if function}}<em class="error-stack-function">{{function}}</em>{{/if}}
|
|
<span class="error-stack-file">({{at}})</span>
|
|
</li>
|
|
{{/foreach}}
|
|
</ul>
|
|
</section>
|
|
{{/if}} |