Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: fix: FatalError set reference to causing error #1257

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ivanjh
Copy link

@ivanjh ivanjh commented Feb 8, 2025

  • All tests pass (no - I don't have suitable tokens to test all integration tests)
  • I have run npm run doc (not part of external api)

Description

FatalError does not provide enough context for understanding underlying issues.
Where available, attach the "causing" error to the FatalError to allow later inspection on .cause (see https://nodejs.org/api/errors.html#errorcause)

Serializing Error objects with util.inspect() recursively serializes error.cause if it is set and would allow better log messages in consuming applications.

I don't believe the existing approach of copying of the stack from the causing error is "least surprise" for consuming authors, but I do not yet understand reasons for why it is as is, or likelihood of breaking existing code.

References

Recent node versions introduced a bug (nodejs/node#54359) in certain network configurations that is becoming more numerous triggering EFATAL errors.

Reports often miss much depth, with only "EFATAL: AggregateError" as a description:

@windkh
Copy link
Contributor

windkh commented Feb 8, 2025

+1

1 similar comment
@tedtribe
Copy link

+1

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.

3 participants