]> git.eshelyaron.com Git - emacs.git/commit
Include more information in error data for sqlite errors
authorJonas Bernoulli <jonas@bernoul.li>
Fri, 21 Oct 2022 20:55:53 +0000 (22:55 +0200)
committerJonas Bernoulli <jonas@bernoul.li>
Fri, 28 Oct 2022 12:33:49 +0000 (14:33 +0200)
commit1073e16960164b901849c32019a373cb1090e20a
tree12e3bc350788ab39d020f3423e3224d41743c2a1
parentf9ed80f9d0ac1cb157e4c0604cc39fd07e7f0842
Include more information in error data for sqlite errors

Introduce a new 'sqlite-error' and use it for all errors signaled in
'src/sqlite.c', except those that already used 'sqlite-locked-error'.
Include the values of 'sqlite3_errcode', 'sqlite3_extended_errcode',
'sqlite3_errstr' and 'sqlite3_errmsg' in the error data.

* src/sqlite.c (load_dll_functions): Load 'sqlite3_extended_errcode'.
(sqlite-load-extension): Use 'xsignal1' as required by argument type.
(syms_of_sqlite): Introduce a new error type 'sqlite-error'.
(check_sqlite, sqlite-open, bind_values, sqlite-execute)
(sqlite-select, sqlite-load-extension, sqlite-next): Use it.
(sqlite_prepare_errdata): New function.
(sqlite_prepare_errmsg): Remove function.
(sqlite-execute, sqlite-select): Use new function.
(sqlite-locked-error): Derive from 'sqlite-error'.
src/sqlite.c