-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
Use sqlite3 extended error codes #68327
Comments
Let's fetch extended error codes from SQLite, information contained is not particularly interesting to the user, but may be invaluable in debugging! http://www.sqlite.org/rescode.html Current behaviour: For example, consider that extended error was SQLITE_READONLY_DBMOVED, it would be set in https://github.com/mackyle/sqlite/blob/1caed0ecc62583c4f8a509ff66ae99b6939fe727/src/pager.c#L4836 without explicit detail string. Python will call sqlite3_errcode() which will strip extended information via Python will then call sqlite3_errmsg(), and the error message will be according to truncated (simple) error per: P.S. there are a few cases where sqlite3 internally sets both error code and message, in those cases, current Python module (presumably) reads out the error message correctly. For example https://github.com/mackyle/sqlite/blob/ebb27fe5bd5045d924d99cdd7dec9b7064c24768/src/main.c#L1584 |
It seems reasonable to provide as much error information as is available, one way or another. Would you like to work on a patch? |
Attached is a patch to enable the extended error codes. This patch should be dependent on bpo-16379. |
Aviv the patch makes in itself. Are the changes in the other ticket needed to implement new tests? |
I meant "the patch makes sense in itself". |
It is not possible to add any tests to this issue before exposing the error code. I will implement new tests when bpo-16379 will be resolved.
I think that this issue should be dependent on bpo-16379 as the behavior of the sqlite module will no be changed after this patch until bpo-16379 is resolved. In addition there will be some "rebase" issues that will need to be solved. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: