From 4aa4a72a3a7e8e3a67797584c68d23ad1e4f2fb8 Mon Sep 17 00:00:00 2001 From: rmotgi1227 Date: Mon, 11 May 2026 12:05:50 -0700 Subject: [PATCH 1/2] fix: log full error object in logerror to preserve Error.cause chain The logerror function was calling console.error(err.stack || err.toString()), which only prints the top-level stack trace and loses nested error context such as Error.cause chains, Sequelize parent/original properties, and other custom error metadata that modern Node.js exposes when logging the full object. Passing err directly to console.error() lets the runtime format the error with its full cause chain and any enumerable properties. --- lib/application.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/application.js b/lib/application.js index 47be2a20c1a..3dc3c6afd6f 100644 --- a/lib/application.js +++ b/lib/application.js @@ -614,11 +614,7 @@ app.listen = function listen() { function logerror(err) { /* istanbul ignore next */ - if (this.get('env') !== 'test') console.error(err.stack || err.toString()); -} - -/** - * Try rendering a view. + if (this.get('env') !== 'test') console.error(err)g a view. * @private */ From 13ee214b872d18ba4d1321bfeb607f30048b735d Mon Sep 17 00:00:00 2001 From: rmotgi1227 Date: Mon, 11 May 2026 12:09:25 -0700 Subject: [PATCH 2/2] fix: restore logerror function structure after initial fix --- lib/application.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/application.js b/lib/application.js index 3dc3c6afd6f..310e6dfef21 100644 --- a/lib/application.js +++ b/lib/application.js @@ -614,7 +614,11 @@ app.listen = function listen() { function logerror(err) { /* istanbul ignore next */ - if (this.get('env') !== 'test') console.error(err)g a view. + if (this.get('env') !== 'test') console.error(err); +} + +/** + * Try rendering a view. * @private */