mirror of
https://github.com/pa11y/pa11y-dashboard.git
synced 2025-09-24 22:31:15 +00:00
Add better error stacks to the log
This commit is contained in:
8
index.js
8
index.js
@@ -11,9 +11,11 @@ require('./app')(config, function (err, app) {
|
||||
console.log(chalk.grey('uri: %s'), app.address);
|
||||
|
||||
app.on('route-error', function (err) {
|
||||
if (err.code === 'ECONNREFUSED') {
|
||||
console.log(chalk.red('Error: could not connect to pa11y-webservice'));
|
||||
}
|
||||
var stack = (err.stack ? err.stack.split('\n') : [err.message]);
|
||||
var msg = chalk.red(stack.shift());
|
||||
console.error('');
|
||||
console.error(msg);
|
||||
console.error(chalk.grey(stack.join('\n')));
|
||||
});
|
||||
|
||||
});
|
||||
|
Reference in New Issue
Block a user