OCapN: improved error messages and testing#2772
Conversation
5de9cd8 to
3801e42
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR improves error messages and testing support across the codebase by adding error wrapping (with nested causes) and stricter decorator-based validations, as well as expanding test coverage for various codecs and passable values. Key changes include:
- Wrapping codec read/write methods with detailed error messages.
- Updating test expectations to use a new throws utility and a less-strict TextDecoder for fuzz tests.
- Renaming and prefixing codec identifiers for clarity and consistency.
Reviewed Changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/ocapn/test/syrup/* | Updated tests to use a non-fatal TextDecoder for fuzz descriptor and standardized error expectations via throws utility |
| packages/ocapn/src/syrup/* | Refactored codec implementations with error wrapping and added codec name parameters |
| packages/ocapn/src/codecs/* | Improved error chaining, renamed codecs with consistent prefixes, and updated union codec implementations |
| packages/ocapn/src/syrup/buffer-reader.js | Fixed a formatting bug in an error message |
| packages/ocapn/test/_table.js & _syrup_util.js | Adjusted test table entries and moved utility functions for consistency |
Comments suppressed due to low confidence (2)
packages/ocapn/src/syrup/buffer-reader.js:110
- The error message now includes a closing parenthesis, which fixes the previous formatting issue. Verify that all similar error messages follow this corrected punctuation for consistency.
`End of data reached (data length = ${state.length}, asked index ${index})`
packages/ocapn/test/syrup/_table.js:13
- There is a duplicate table entry with syrup '1-' and value -1n. Confirm whether this duplication is intentional or if the redundant entry should be removed.
{ syrup: '1-', value: -1n },
|
@erights in order to avoid blocking this PR on |
…ass-style selectors
fe3ebc4 to
41f429e
Compare
|
@kriskowal has suggested i use registered symbols in the interim |
|
I decided to just include these changes in #2781 and keep working for awhile |
|
sorry - #2781 |
some small improvements:
related to
@endo/pass-stylesupport of non-registered Symbols (#2777)