mirror of
https://github.com/pa11y/pa11y-dashboard.git
synced 2025-09-24 22:31:15 +00:00
Add a stack trace to the 500 page in dev mode
This commit is contained in:
3
app.js
3
app.js
@@ -66,6 +66,9 @@ function initApp (config, callback) {
|
|||||||
app.express.use(function (err, req, res, next) {
|
app.express.use(function (err, req, res, next) {
|
||||||
/* jshint unused: false */
|
/* jshint unused: false */
|
||||||
app.emit('route-error', err);
|
app.emit('route-error', err);
|
||||||
|
if (process.env.NODE_ENV !== 'production') {
|
||||||
|
res.locals.error = err;
|
||||||
|
}
|
||||||
res.status(500);
|
res.status(500);
|
||||||
res.render('500');
|
res.render('500');
|
||||||
});
|
});
|
||||||
|
@@ -2,8 +2,10 @@
|
|||||||
<h1>Eeek! 500 error. This is serious.</h1>
|
<h1>Eeek! 500 error. This is serious.</h1>
|
||||||
<p class="h2">There isn't much you can do about this.</h2>
|
<p class="h2">There isn't much you can do about this.</h2>
|
||||||
<p class="h4">Give it another go or try the <a href="/">home page</a>.</h4>
|
<p class="h4">Give it another go or try the <a href="/">home page</a>.</h4>
|
||||||
<p>Techy-stuff</p>
|
{{#if error}}
|
||||||
<pre><p>Sample text here...</p></pre>
|
<h2>Stack-Trace</h2>
|
||||||
|
<pre>{{error.stack}}</pre>
|
||||||
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<div class="well well-lg">
|
<div class="well well-lg">
|
||||||
|
Reference in New Issue
Block a user