-
Notifications
You must be signed in to change notification settings - Fork 79
feat(ses): can breakpoint or log on assert failures #2689
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
base: master
Are you sure you want to change the base?
Conversation
aee6bd2 to
1385a6c
Compare
| * - `sanitizeError` will freeze the error, preventing any correct engine from | ||
| * adding or | ||
| * altering any of the error's own properties `sanitizeError` is done. | ||
| * altering any of the error's own properties once `sanitizeError` is done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a driveby typo fix
1385a6c to
787e0a0
Compare
787e0a0 to
118e02e
Compare
118e02e to
7e38297
Compare
7e38297 to
39820b8
Compare
39820b8 to
2564f2b
Compare
44f6330 to
8f9a3b0
Compare
8f9a3b0 to
3fdc99b
Compare
| debugger; | ||
| } else if (viewAssertError === 'log') { | ||
| // eslint-disable-next-line @endo/no-polymorphic-call | ||
| console.log(error); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
console.error may be more appropriate 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds debugging capabilities for assert failures in the SES package by introducing environment variable configuration to allow breakpoints or logging when errors are created.
- Adds
SES_VIEW_ASSERT_ERRORenvironment variable support with options for 'breakpoint', 'log', or 'none' - Implements conditional debugging behavior in the
makeErrorfunction - Fixes a minor typo in a comment about
sanitizeError
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| const viewAssertError = getenv('SES_VIEW_ASSERT_ERROR', 'none', [ | ||
| 'breakpoint', | ||
| 'log', | ||
| ]); | ||
| if (viewAssertError !== 'none') { | ||
| if (viewAssertError === 'breakpoint') { | ||
| // eslint-disable-next-line no-debugger | ||
| debugger; | ||
| } else if (viewAssertError === 'log') { | ||
| // eslint-disable-next-line @endo/no-polymorphic-call | ||
| console.log(error); | ||
| } | ||
| } |
Copilot
AI
Sep 16, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The environment variable is checked on every error creation. Consider caching the environment variable value at module initialization to avoid repeated calls to getenv on the error path.
3fdc99b to
45b457f
Compare
45b457f to
f55a949
Compare
Closes: #XXXX
Refs: #XXXX
Description
Security Considerations
Scaling Considerations
Documentation Considerations
Testing Considerations
Compatibility Considerations
Upgrade Considerations