Skip to content

Conversation

@aryamohanan
Copy link
Contributor

@aryamohanan aryamohanan commented Feb 9, 2026

Enhanced bunyan instrumentation to support Node.js error.cause feature.

Same did for console, see #2286

ref: https://jsw.ibm.com/browse/INSTA-71403

@aryamohanan aryamohanan changed the title feat(bunyan): included error cause in messages when available feat(bunyan): added support for error cause Feb 9, 2026
@aryamohanan aryamohanan marked this pull request as ready for review February 10, 2026 07:58
@aryamohanan aryamohanan requested a review from a team as a code owner February 10, 2026 07:58
@aryamohanan aryamohanan changed the title feat(bunyan): added support for error cause feat(bunyan): added support for error.cause Feb 10, 2026
// CASE: logger.error(new Error('msg'), 'another msg')
const errorMessage = tracingUtil.extractErrorMessage(fields);
message = `${errorMessage} -- ${message}`;
} else if (fields instanceof Error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can improve the readability here a lot.

const x = fields.err || fields.

+

if (fields instanceof Error) {
  const errorMessage = tracingUtil.extractErrorMessage(fields);
  
   if (typeof message === 'string')
   ....
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ofcourse!

@aryamohanan aryamohanan force-pushed the feat-err-cause-bunyan branch from 0a70ed0 to 0a25112 Compare February 10, 2026 08:40
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants