gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [taler-exchange] branch master updated: fix logging of BEGI


From: gnunet
Subject: [GNUnet-SVN] [taler-exchange] branch master updated: fix logging of BEGIN error
Date: Tue, 14 Mar 2017 15:34:28 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new 6d798ce  fix logging of BEGIN error
6d798ce is described below

commit 6d798cecba4902623ca2769b30f6b1a0f554d83e
Author: Christian Grothoff <address@hidden>
AuthorDate: Tue Mar 14 15:36:19 2017 +0100

    fix logging of BEGIN error
---
 src/exchangedb/plugin_exchangedb_postgres.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/src/exchangedb/plugin_exchangedb_postgres.c 
b/src/exchangedb/plugin_exchangedb_postgres.c
index febbf0c..e14e4aa 100644
--- a/src/exchangedb/plugin_exchangedb_postgres.c
+++ b/src/exchangedb/plugin_exchangedb_postgres.c
@@ -1426,14 +1426,16 @@ postgres_start (void *cls,
                 struct TALER_EXCHANGEDB_Session *session)
 {
   PGresult *result;
+  ExecStatusType ex;
 
   result = PQexec (session->conn,
                    "START TRANSACTION ISOLATION LEVEL SERIALIZABLE");
   if (PGRES_COMMAND_OK !=
-      PQresultStatus (result))
+      (ex = PQresultStatus (result)))
   {
-    TALER_LOG_ERROR ("Failed to start transaction: %s\n",
-               PQresultErrorMessage (result));
+    TALER_LOG_ERROR ("Failed to start transaction (%s): %s\n",
+                     PQresStatus (ex),
+                     PQerrorMessage (session->conn));
     GNUNET_break (0);
     PQclear (result);
     return GNUNET_SYSERR;
@@ -1918,7 +1920,11 @@ postgres_reserves_in_insert (void *cls,
   }
   if (GNUNET_OK != postgres_commit (cls,
                                     session))
+  {
+    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+                "Failed to commit transaction adding amount to reserve\n");
     return GNUNET_SYSERR;
+  }
   return GNUNET_OK;
 
  rollback:
@@ -2173,7 +2179,7 @@ postgres_get_reserve_history (void *cls,
       }
       rh_tail->type = TALER_EXCHANGEDB_RO_BANK_TO_EXCHANGE;
       rh_tail->details.bank = bt;
-    }
+    } /* end of 'while (0 < rows)' */
     PQclear (result);
   }
   {
@@ -2232,7 +2238,7 @@ postgres_get_reserve_history (void *cls,
       rh_tail = rh_tail->next;
       rh_tail->type = TALER_EXCHANGEDB_RO_WITHDRAW_COIN;
       rh_tail->details.withdraw = cbc;
-    }
+    } /* end of 'while (0 < rows)' */
     ret = GNUNET_OK;
     PQclear (result);
   }

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]