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

Try real hard to surface error details #1062

Merged
merged 3 commits into from
Jul 29, 2024

Conversation

lauckhart
Copy link
Collaborator

Some environments do not report Error#cause or AggregateError#errors. Or if they do they may not report them when deeply nested (e.g. with Node's default util.inspect implementation).

To work around this, on node.js we now monitor uncaught exceptions and report them in matter.js logs using matter.js's formatting. We also offer error formatting via MatterError#format() and provide a custom inspector for node.js.

Includes related improvements:

  • Modifies object formatting so it's available outside of logging
  • Adds more comprehensive tests for error formatting logic

Some environments do not report `Error#cause` or `AggregateError#errors`.  Or if they do they may not report them when
deeply nested (e.g. with Node's default `util.inspect` implementation).

To work around this, on node.js we now monitor uncaught exceptions and report them in matter.js logs using matter.js's
formatting.  We also offer error formatting via `MatterError#format()` and provide a custom inspector for node.js.

Includes related improvements:

  - Modifies object formatting so it's available outside of logging
  - Adds more comprehensive tests for error formatting logic
The new test fails on 16.x but we'll no longer support it after project-chip#1054 lands so disabling tests here.
@Apollon77
Copy link
Collaborator

PS: After all got merged I will do a PR to try nodejs 22 in testing ...

@lauckhart
Copy link
Collaborator Author

PS: After all got merged I will do a PR to try nodejs 22 in testing ...

Oh good I was going to mention

@Apollon77 Apollon77 merged commit 47f7f1c into project-chip:main Jul 29, 2024
8 checks passed
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.

None yet

2 participants