gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated: fix error code use


From: gnunet
Subject: [taler-exchange] branch master updated: fix error code use
Date: Fri, 17 Jan 2020 03:42:38 +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 7995678e fix error code use
7995678e is described below

commit 7995678e776b719145aeaf9e4409b6dd694c253e
Author: Christian Grothoff <address@hidden>
AuthorDate: Fri Jan 17 03:42:31 2020 +0100

    fix error code use
---
 src/exchange/taler-exchange-httpd_keystate.c       | 11 ++++-------
 src/exchange/taler-exchange-httpd_refresh_reveal.c |  3 +--
 src/include/taler_error_codes.h                    | 13 +++++++++++++
 3 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/src/exchange/taler-exchange-httpd_keystate.c 
b/src/exchange/taler-exchange-httpd_keystate.c
index 4115fe66..31cb1368 100644
--- a/src/exchange/taler-exchange-httpd_keystate.c
+++ b/src/exchange/taler-exchange-httpd_keystate.c
@@ -2285,11 +2285,6 @@ TEH_KS_free ()
 /**
  * Sign the message in @a purpose with the exchange's signing key.
  *
- * FIXME:
- * - Change API to return status code and do not assert on TEH_KS_acquire()
- *   failures, instead allow caller to handle it (i.e. by returning
- *   #TALER_EC_EXCHANGE_BAD_CONFIGURATION to application).
- *
  * @param purpose the message to sign
  * @param[out] pub set to the current public signing key of the exchange
  * @param[out] sig signature over purpose using current signing key
@@ -2451,9 +2446,11 @@ TEH_KS_handler_keys (struct TEH_RequestHandler *rh,
   }
   if (NULL == krd)
   {
-    /* FIXME: should return 500 response instead... */
     GNUNET_break (0);
-    return MHD_NO;
+    return TALER_MHD_reply_with_error (connection,
+                                       MHD_HTTP_INTERNAL_SERVER_ERROR,
+                                       TALER_EC_KEYS_MISSING,
+                                       "no key response found");
   }
   ret = MHD_queue_response (connection,
                             rh->response_code,
diff --git a/src/exchange/taler-exchange-httpd_refresh_reveal.c 
b/src/exchange/taler-exchange-httpd_refresh_reveal.c
index fb2602c6..9a8d929f 100644
--- a/src/exchange/taler-exchange-httpd_refresh_reveal.c
+++ b/src/exchange/taler-exchange-httpd_refresh_reveal.c
@@ -608,10 +608,9 @@ handle_refresh_reveal_json (struct MHD_Connection 
*connection,
     if (NULL == key_state)
     {
       TALER_LOG_ERROR ("Lacking keys to operate\n");
-      /* FIXME: use correct EC code! */
       return TALER_MHD_reply_with_error (connection,
                                          MHD_HTTP_INTERNAL_SERVER_ERROR,
-                                         TALER_EC_REFRESH_REVEAL_SIGNING_ERROR,
+                                         TALER_EC_REFRESH_REVEAL_KEYS_MISSING,
                                          "exchange lacks keys");
     }
 
diff --git a/src/include/taler_error_codes.h b/src/include/taler_error_codes.h
index b6f73681..30df731c 100644
--- a/src/include/taler_error_codes.h
+++ b/src/include/taler_error_codes.h
@@ -652,6 +652,13 @@ enum TALER_ErrorCode
    */
   TALER_EC_REFRESH_REVEAL_LINK_SIGNATURE_INVALID = 1382,
 
+  /**
+   * The exchange failed to generate the signature as it could not find
+   * the signing key for the denomination. This response is provided
+   * with HTTP status code MHD_HTTP_INTERNAL_SERVER_ERROR.
+   */
+  TALER_EC_REFRESH_REVEAL_KEYS_MISSING = 1383,
+
   /**
    * The coin specified in the link request is unknown to the exchange.
    * This response is provided with HTTP status code MHD_HTTP_NOT_FOUND.
@@ -939,6 +946,12 @@ enum TALER_ErrorCode
    */
   TALER_EC_KEYS_HAVE_NOT_NUMERIC = 1900,
 
+  /**
+   * We currently cannot find any keys. This reponse is provied with an
+   * HTTP status code of MHD_HTTP_INTERNAL_SERVER_ERROR.
+   */
+  TALER_EC_KEYS_MISSING = 1901,
+
   /**
    * The backend could not find the merchant instance specified in the
    * request.   This response is provided with HTTP status code

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



reply via email to

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