summaryrefslogtreecommitdiffstats
path: root/Modules/_sqlite/util.c
diff options
context:
space:
mode:
authorErlend Egeberg Aasland <erlend.aasland@protonmail.com>2022-05-04 13:16:01 (GMT)
committerGitHub <noreply@github.com>2022-05-04 13:16:01 (GMT)
commit090819ec5faea2d0c2cdf6bcfdbbc9df144a8aad (patch)
tree71881b44e7ffb8eaa92dcdfc88a6ad037bc057d9 /Modules/_sqlite/util.c
parentd716a0dfe2d1029111db393afaecdb04cc4093de (diff)
downloadcpython-090819ec5faea2d0c2cdf6bcfdbbc9df144a8aad.zip
cpython-090819ec5faea2d0c2cdf6bcfdbbc9df144a8aad.tar.gz
cpython-090819ec5faea2d0c2cdf6bcfdbbc9df144a8aad.tar.bz2
gh-89022: Improve sqlite3 exceptions related to binding params and API misuse (#91572)
* Map SQLITE_MISUSE to sqlite3.InterfaceError SQLITE_MISUSE implies misuse of the SQLite C API, which, if it happens, is _not_ a user error; it is an sqlite3 extension module error. * Raise better errors when binding parameters fail. Instead of always raising InterfaceError, guessing what went wrong, raise accurate exceptions with more accurate error messages.
Diffstat (limited to 'Modules/_sqlite/util.c')
-rw-r--r--Modules/_sqlite/util.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/Modules/_sqlite/util.c b/Modules/_sqlite/util.c
index 37b2dd6..2b3bbfe 100644
--- a/Modules/_sqlite/util.c
+++ b/Modules/_sqlite/util.c
@@ -59,7 +59,6 @@ get_exception_class(pysqlite_state *state, int errorcode)
case SQLITE_MISMATCH:
return state->IntegrityError;
case SQLITE_MISUSE:
- return state->ProgrammingError;
case SQLITE_RANGE:
return state->InterfaceError;
default: