gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-backoffice] branch master updated: Errors mgmt.


From: gnunet
Subject: [GNUnet-SVN] [taler-backoffice] branch master updated: Errors mgmt.
Date: Fri, 08 Jun 2018 10:24:15 +0200

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

marcello pushed a commit to branch master
in repository backoffice.

The following commit(s) were added to refs/heads/master by this push:
     new db02e1e  Errors mgmt.
db02e1e is described below

commit db02e1ed042013a32ed45ae1c4b831a842c9cc3a
Author: Marcello Stanisci <address@hidden>
AuthorDate: Fri Jun 8 10:23:51 2018 +0200

    Errors mgmt.
    
    Tolerate error codes given as strings.
---
 js/backoffice.js | 46 +++++++++++++++++++++++-----------------------
 1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/js/backoffice.js b/js/backoffice.js
index 7563580..e22c1a1 100644
--- a/js/backoffice.js
+++ b/js/backoffice.js
@@ -64,54 +64,54 @@ var SCROLL = true;
  * to friendlier messages.
  */
 function error_map(code){
-  switch (code){
+  switch (Number(code)){
 
   /* /history errors.  */
-  case "2200":
+  case 2200:
     return "The timestamp used to query the history overflowed.";
-  case "2201":
+  case 2201:
     return "Merchant had serious problems in its history database";
-  case "2202":
+  case 2202:
     return "The instance used to query the history is unknown";
 
   /* /track/order errors.  */
-  case "2307":
+  case 2307:
     /* Such errors should provide full proof to the user.  */
     return "One of the coin was untraceable";
-  case "2308":
-  case "2408":
+  case 2308:
+  case 2408:
     return "Conflicting reports from the Exchange";
-  case "2301":
+  case 2301:
     return "Instance is unknown to track this order";
-  case "2303":
-  case "2304":
-  case "2305":
-  case "1801":
+  case 2303:
+  case 2304:
+  case 2305:
+  case 1801:
     return "Merchant database failed, code:" + code;
-  case "2306":
+  case 2306:
     return "One of the coin failed at getting its WTID";
 
   /* /track/transfer errors.  */
-  case "2410":
+  case 2410:
     return "Exchange charged a higher wire fee than what " +
            " it was originally advertised.";
-  case "2405":
+  case 2405:
     return "Error from the exchange, no proof received!";
-  case "2404":
-  case "2402":
+  case 2404:
+  case 2402:
     return "Database failure, could not store results: " + code;
-  case "2406":
+  case 2406:
     return "Database failure, could not retrieve previous results";
-  case "2407":
+  case 2407:
     return "Database failure, internal logic error";
-  case "2409":
+  case 2409:
     return "Merchant could not pack the JSON response";
-  case "2403":
+  case 2403:
     return "Merchant failed to request /track/transfer to \
             the exchange";
-  case "2400":
+  case 2400:
     return "Exchange timed out..";
-  case "2503":
+  case 2503:
     return "Proposal not found.";
 
   default:

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



reply via email to

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