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

Do not sanitize internal error messages in jsg::annotateBroken() #542

Merged
merged 1 commit into from
Apr 17, 2023

Conversation

bcaimano
Copy link
Contributor

@bcaimano bcaimano commented Apr 14, 2023

This commit does the following:

  • Preserves the original message for internal exceptions that pass through jsg::annotateBroken(). It turns out that we only expect to see non-JSG messages in situations where Worker::Actor::Impl::makeStorage() throws. Up until recently, all storage interfaces had trivial construction, so it was never an issue. Since this is difficult to do in a testing environment, I have verified the messages manually.
  • Reorganizes cases when making a DecodedException so that kj exceptions get their own branch with a default exception.
  • Sanitizes jsg-internal exceptions when extracting descriptions for use with the worker logging.
  • Logs at info level when we annotate an exception with brokenness.

This commit does the following:
- Preserves the original message for internal exceptions that pass through jsg::annotateBroken(). It turns out that we only expect to see non-JSG messages in situations where `Worker::Actor::Impl::makeStorage()` throws. Up until recently, all storage interfaces had trivial construction, so it was never an issue. Since this is difficult to do in a testing environment, I have verified the messages manually.
- Reorganizes cases when making a `DecodedException` so that kj exceptions get their own branch with a default exception.
- Sanitizes jsg-internal exceptions when extracting descriptions for use with the worker logging.
- Logs at info level when we annotate an exception with brokenness.
@bcaimano bcaimano force-pushed the bcaimano/fix-annotate-brokenness branch from 5f28bd9 to b57bedb Compare April 17, 2023 15:42
@bcaimano bcaimano merged commit ff90ad3 into main Apr 17, 2023
@bcaimano bcaimano deleted the bcaimano/fix-annotate-brokenness branch April 17, 2023 17:14
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.

2 participants