From e16844dbee396b74f52d3413ba6efec26a0c032f Mon Sep 17 00:00:00 2001 From: Ron Pedde Date: Mon, 8 May 2006 05:36:15 +0000 Subject: [PATCH] Fix logging error that crashes on bad database --- src/db-sql.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/db-sql.c b/src/db-sql.c index 2c28decb..8d96eaa7 100644 --- a/src/db-sql.c +++ b/src/db-sql.c @@ -177,13 +177,15 @@ int db_sql_fetch_row(char **pe, SQL_ROW *row, char *fmt, ...) { db_sql_vmfree_fn(query); if(err != DB_E_SUCCESS) { - DPRINTF(E_SPAM,L_DB,"Error: enum_begin failed: %s\n",(pe) ? *pe : "?"); + DPRINTF(E_SPAM,L_DB,"Error: enum_begin failed (error %d): %s\n", + err,(pe) ? *pe : "?"); return err; } err=db_sql_enum_fetch_fn(pe, row); if(err != DB_E_SUCCESS) { - DPRINTF(E_SPAM,L_DB,"Error: enum_fetch failed: %s\n",*pe); + DPRINTF(E_SPAM,L_DB,"Error: enum_fetch failed (error %d): %s\n", + err,(pe) ? *pe : "?"); db_sql_enum_end_fn(NULL); return err; }