From 031262f0bd2be3e53019d65cd7aafff80b72e155 Mon Sep 17 00:00:00 2001 From: armorbreak001 Date: Mon, 15 Jun 2026 00:45:09 +0800 Subject: [PATCH] fix: preserve full error details in logerror by logging error object console.error(err.stack || err.toString()) strips important error properties like Error.cause, custom properties added by libraries (e.g. Sequelize's parent/original), and async stack trace context. Changing to console.error(err) preserves the complete error object output while still showing stack traces. This matches modern Node.js behavior where console.error handles Error objects comprehensively. Fixes #6462 --- lib/application.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/application.js b/lib/application.js index 47be2a20c1a..310e6dfef21 100644 --- a/lib/application.js +++ b/lib/application.js @@ -614,7 +614,7 @@ 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); } /**