summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSree Harsha Totakura <sreeharsha@totakura.in>2015-03-05 17:55:19 +0100
committerSree Harsha Totakura <sreeharsha@totakura.in>2015-03-06 10:32:53 +0100
commit7aab16da3430a388b2437c3299e835f9b8a5f9fc (patch)
treed008415d4b7c3e41de22229ef713c0407df5151d
parent234cdb4a62e65bbb14c0391900d50f83a132eb0e (diff)
downloadexchange-7aab16da3430a388b2437c3299e835f9b8a5f9fc.tar.gz
exchange-7aab16da3430a388b2437c3299e835f9b8a5f9fc.tar.bz2
exchange-7aab16da3430a388b2437c3299e835f9b8a5f9fc.zip
db: Add QUERY_ERR macro to log failed queries
-rw-r--r--src/mint/mint_db.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mint/mint_db.c b/src/mint/mint_db.c
index 07ec56776..0bd888221 100644
--- a/src/mint/mint_db.c
+++ b/src/mint/mint_db.c
@@ -42,6 +42,9 @@
static pthread_key_t db_conn_threadlocal;
+#define QUERY_ERR(result) \
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "%s: query failed: %s\n", __FUNCTION__, PQresultErrorMessage (result))
+
/**
* Database connection string, as read from
* the configuration.
@@ -699,9 +702,7 @@ TALER_MINT_DB_reserve_get (PGconn *db,
params);
if (PGRES_TUPLES_OK != PQresultStatus (result))
{
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Query failed: %s\n",
- PQresultErrorMessage (result));
+ QUERY_ERR (result);
PQclear (result);
return GNUNET_SYSERR;
}