mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-28 08:05:56 -05:00
Enhance db_exec() error messages
This commit is contained in:
parent
75dc4106a8
commit
4594cc3d63
4
src/db.c
4
src/db.c
@ -542,7 +542,7 @@ db_exec(const char *query, char **errmsg)
|
|||||||
ret = db_blocking_prepare_v2(query, -1, &stmt, NULL);
|
ret = db_blocking_prepare_v2(query, -1, &stmt, NULL);
|
||||||
if (ret != SQLITE_OK)
|
if (ret != SQLITE_OK)
|
||||||
{
|
{
|
||||||
*errmsg = sqlite3_mprintf("%s", sqlite3_errmsg(hdl));
|
*errmsg = sqlite3_mprintf("prepare failed: %s", sqlite3_errmsg(hdl));
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -551,7 +551,7 @@ db_exec(const char *query, char **errmsg)
|
|||||||
|
|
||||||
if (ret != SQLITE_DONE)
|
if (ret != SQLITE_DONE)
|
||||||
{
|
{
|
||||||
*errmsg = sqlite3_mprintf("%s", sqlite3_errmsg(hdl));
|
*errmsg = sqlite3_mprintf("step failed: %s", sqlite3_errmsg(hdl));
|
||||||
|
|
||||||
sqlite3_finalize(stmt);
|
sqlite3_finalize(stmt);
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
Reference in New Issue
Block a user