gnunet-svn
[Top][All Lists]
Advanced

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

[taler-anastasis] branch master updated: -better error handling


From: gnunet
Subject: [taler-anastasis] branch master updated: -better error handling
Date: Sun, 11 Jul 2021 16:38:47 +0200

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

grothoff pushed a commit to branch master
in repository anastasis.

The following commit(s) were added to refs/heads/master by this push:
     new 092a3dd  -better error handling
092a3dd is described below

commit 092a3dd6b202c47b48ce5483676766db46dbfc83
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sun Jul 11 16:38:45 2021 +0200

    -better error handling
---
 src/backend/anastasis-httpd_truth_upload.c                       | 8 +++++---
 src/cli/.gitignore                                               | 1 +
 src/cli/test_anastasis_reducer_recovery_enter_user_attributes.sh | 6 ++++++
 src/reducer/anastasis_api_backup_redux.c                         | 5 ++++-
 src/restclient/anastasis_api_truth_store.c                       | 7 +++++++
 5 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/src/backend/anastasis-httpd_truth_upload.c 
b/src/backend/anastasis-httpd_truth_upload.c
index a408dcd..56000f8 100644
--- a/src/backend/anastasis-httpd_truth_upload.c
+++ b/src/backend/anastasis-httpd_truth_upload.c
@@ -338,8 +338,9 @@ check_payment_cb (void *cls,
           &tuc->truth_uuid,
           &osr->details.paid.deposit_total,
           paid_until);
-        if (qs <= 0)
+        if (qs < 0)
         {
+          GNUNET_break (0);
           tuc->response_code = MHD_HTTP_INTERNAL_SERVER_ERROR;
           tuc->resp = TALER_MHD_make_error (
             TALER_EC_GENERIC_DB_STORE_FAILED,
@@ -750,8 +751,9 @@ AH_handler_truth_post (
   }
 
 
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Storing truth!\n");
+  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+              "Storing truth until %s!\n",
+              GNUNET_STRINGS_absolute_time_to_string (paid_until));
   qs = db->store_truth (db->cls,
                         truth_uuid,
                         &keyshare_data,
diff --git a/src/cli/.gitignore b/src/cli/.gitignore
index bc8182c..dbf01fa 100644
--- a/src/cli/.gitignore
+++ b/src/cli/.gitignore
@@ -3,3 +3,4 @@ anastasis-reducer
 test_reducer_home
 *.trs
 taler-bank.err
+wallet.err
diff --git a/src/cli/test_anastasis_reducer_recovery_enter_user_attributes.sh 
b/src/cli/test_anastasis_reducer_recovery_enter_user_attributes.sh
index bd4617c..403bc89 100755
--- a/src/cli/test_anastasis_reducer_recovery_enter_user_attributes.sh
+++ b/src/cli/test_anastasis_reducer_recovery_enter_user_attributes.sh
@@ -362,6 +362,10 @@ echo -e "Running wallet run-pending..."
 taler-wallet-cli --wallet-db=$WALLET_DB run-pending 2>/dev/null >/dev/null
 echo -e "Payments done"
 
+export B2FILE
+export B1FILE
+bash
+
 echo -en "Try to upload again ..."
 $PREFIX anastasis-reducer pay $B2FILE $B1FILE
 mv $B1FILE $B2FILE
@@ -477,12 +481,14 @@ echo -n "Checking recovered secret ..."
 STATE=`jq -r -e .recovery_state < $R2FILE`
 if test "$STATE" != "RECOVERY_FINISHED"
 then
+    jq < $R2FILE
     exit_fail "Expected new state to be 'RECOVERY_FINISHED', got '$STATE'"
 fi
 
 SECRET=`jq -r -e .core_secret.value < $R2FILE`
 if test "$SECRET" != "VERYHARDT0GVESSSECRET"
 then
+    jq < $R2FILE
     exit_fail "Expected recovered secret to be 'VERYHARDT0GVESSSECRET', got 
'$SECRET'"
 fi
 
diff --git a/src/reducer/anastasis_api_backup_redux.c 
b/src/reducer/anastasis_api_backup_redux.c
index 7044eae..f42dd3f 100644
--- a/src/reducer/anastasis_api_backup_redux.c
+++ b/src/reducer/anastasis_api_backup_redux.c
@@ -3284,9 +3284,12 @@ check_upload_finished (struct UploadContext *uc)
   {
     if (TALER_EC_NONE != tue->ec)
     {
+      GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+                  "Truth upload failed with error %d\n",
+                  (int) tue->ec);
       uc->cb (uc->cb_cls,
               tue->ec,
-              uc->state);
+              NULL);
       upload_cancel_cb (uc);
       return;
     }
diff --git a/src/restclient/anastasis_api_truth_store.c 
b/src/restclient/anastasis_api_truth_store.c
index 20bcde4..ebd7d10 100644
--- a/src/restclient/anastasis_api_truth_store.c
+++ b/src/restclient/anastasis_api_truth_store.c
@@ -165,7 +165,14 @@ handle_truth_store_finished (void *cls,
     ud.ec = TALER_JSON_get_error_code2 (data,
                                         data_size);
     break;
+  case MHD_HTTP_INTERNAL_SERVER_ERROR:
+    ud.ec = TALER_JSON_get_error_code2 (data,
+                                        data_size);
+    break;
   default:
+    GNUNET_break (0);
+    ud.ec = TALER_JSON_get_error_code2 (data,
+                                        data_size);
     break;
   }
   tso->cb (tso->cb_cls,

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

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