Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion lib/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,16 @@ app.listen = function listen() {

function logerror(err) {
/* istanbul ignore next */
if (this.get('env') !== 'test') console.error(err.stack || err.toString());
if (this.get('env') !== 'test') {
console.error(err.stack || err.toString());

// Log the error cause chain if present
let currentCause = err.cause;
while (currentCause) {
console.error('\nCaused by:', currentCause.stack || currentCause.toString());
currentCause = currentCause.cause;
}
}
}

/**
Expand Down