GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||
GeezerVison is showing github.com — sqlite: propagate option getter errors and dedupe boolean options by araujogui · Pull Request #66748 · nodejs/node Conversation
Member
Every boolean option in the binding now goes through a single
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsThe readBigInts, returnArrays, allowBareNamedParameters and allowUnknownNamedParameters options were read with `if (Get().ToLocal())`, so a throwing getter left an exception pending while the constructor carried on. Option parsing continued, the database was opened, and the exception was lost, leaving a database file on disk for a constructor call that should have failed. Return as soon as reading any of these options fails, matching how every other option is handled. Signed-off-by: Guilherme Araújo <[email protected]> Assisted-by: Claude Reading an optional boolean option took about 15 lines of Get/IsUndefined/IsBoolean/throw, repeated for every option across Database's constructor, prepare(), function(), aggregate() and createModule(). That repetition is also what let a missing early return slip into four of the constructor's options. Add ReadOptionalBool(), which reads one property, validates it and reports whether an exception is pending, and use it for every boolean option. Options are still read in the same order, and the error messages are unchanged. Signed-off-by: Guilherme Araújo <[email protected]> Assisted-by: Claude
Collaborator
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
|
There was an error while loading. Please reload this page.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@ ## main #66748 +/- ## ========================================== + Coverage 90.47% 90.49% +0.02% ========================================== Files 791 797 +6 Lines 277225 277250 +25 Branches 53313 53273 -40 ========================================== + Hits 250829 250908 +79 + Misses 16801 16780 -21 + Partials 9595 9562 -33
🚀 New features to boost your workflow:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Landed in 1bffd1d |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
The readBigInts, returnArrays, allowBareNamedParameters and allowUnknownNamedParameters options were read with `if (Get().ToLocal())`, so a throwing getter left an exception pending while the constructor carried on. Option parsing continued, the database was opened, and the exception was lost, leaving a database file on disk for a constructor call that should have failed. Return as soon as reading any of these options fails, matching how every other option is handled. Signed-off-by: Guilherme Araújo <[email protected]> Assisted-by: Claude PR-URL: #66748 Reviewed-By: Matteo Collina <[email protected]>
The readBigInts, returnArrays, allowBareNamedParameters and allowUnknownNamedParameters options were read with `if (Get().ToLocal())`, so a throwing getter left an exception pending while the constructor carried on. Option parsing continued, the database was opened, and the exception was lost, leaving a database file on disk for a constructor call that should have failed. Return as soon as reading any of these options fails, matching how every other option is handled. Signed-off-by: Guilherme Araújo <[email protected]> Assisted-by: Claude PR-URL: nodejs#66748 Reviewed-By: Matteo Collina <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.