Include extended error codes in error messages#6321
Conversation
There was a problem hiding this comment.
I'm Bonk, and I've done a quick review of your PR.
This PR adds the SQLite extended error code to error messages in dbErrorMessage(). A few issues:
-
[MEDIUM] Extended error code is appended as a raw integer.
sqlite3_extended_errcode()returns anint— appending it directly produces something likeSQLITE_CONSTRAINT- 19(orSQLITE_CONSTRAINT- 2067forSQLITE_CONSTRAINT_UNIQUE). The raw number isn't useful for debugging. Consider usingsqlite3_errstr()which accepts extended error codes and returns a human-readable string (e.g.,"UNIQUE constraint failed"). -
[LOW] Missing space before dash. The format string
"- "producesSQLITE_ERROR- 1— there should be a space before the dash for readability. -
[LOW] Variable naming.
extendedErrorMessageis misleading sincesqlite3_extended_errcode()returns anint, not a message string. Something likeextendedErrorCodewould be more accurate.
These comments were generated by an AI code review assistant and may not be perfect.
|
Review posted successfully on PR #6321. Here's a summary of the findings:
I also included a concrete suggestion that only appends the extended code when it differs from the primary code (to avoid redundant output like |
Co-authored-by: zachlefevre <zachlefevre@users.noreply.github.com>
Co-authored-by: zachlefevre <zachlefevre@users.noreply.github.com>
660d3c2 to
f49f49b
Compare
|
error: Your local changes to the following files would be overwritten by checkout: |
|
@zachlefevre Bonk workflow failed. Check the logs for details. View workflow run · To retry, trigger Bonk again. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6321 +/- ##
==========================================
- Coverage 70.68% 70.65% -0.03%
==========================================
Files 420 420
Lines 113010 113139 +129
Branches 18531 18615 +84
==========================================
+ Hits 79881 79939 +58
+ Misses 22086 22077 -9
- Partials 11043 11123 +80 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
justin-mp
left a comment
There was a problem hiding this comment.
The branch includes weird changes from main. Please rebase on main rather than merging.
|
This LGTM, and I'm happy to approve, but I think we need to rebase on |
877bb01 to
dce6b65
Compare
justin-mp
left a comment
There was a problem hiding this comment.
non-blocking nit: It would be better if the test and the change were in the same commit.
dce6b65 to
fa43314
Compare
SQLITE error logs should include that error's extended error code.