Skip to content

fix: logError now logs full error including cause (fixes #6462) - #1

Open
ErnestHysa wants to merge 1 commit into
masterfrom
fix/6462-logError-swallows-cause
Open

ErnestHysa wants to merge 1 commit into
masterfrom
fix/6462-logError-swallows-cause

Conversation

@ErnestHysa

Copy link
Copy Markdown
Owner

Fixes expressjs#6462 - logError swallows cause

Changed console.error(err.stack || err.toString()) to console.error(err) so that the full error including the cause chain is logged properly.

When an error with a cause property is logged, using err.stack alone loses that information. Passing err directly to console.error ensures the full error details including the cause chain are output.

Fixes expressjs#6462 - logError swallows cause

Changed console.error(err.stack || err.toString()) to console.error(err)
so that the full error including the cause chain is logged properly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

logError swallows error details (such as cause)

1 participant