aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/exchange_api_link.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/exchange_api_link.c b/src/lib/exchange_api_link.c
index aa508ecf3..756340494 100644
--- a/src/lib/exchange_api_link.c
+++ b/src/lib/exchange_api_link.c
@@ -350,11 +350,13 @@ handle_link_finished (void *cls,
{
struct TALER_EXCHANGE_LinkHandle *lh = cls;
const json_t *j = response;
+ enum TALER_ErrorCode ec;
lh->job = NULL;
switch (response_code)
{
case 0:
+ ec = TALER_EC_INVALID_RESPONSE;
break;
case MHD_HTTP_OK:
if (GNUNET_OK !=
@@ -366,14 +368,17 @@ handle_link_finished (void *cls,
}
break;
case MHD_HTTP_BAD_REQUEST:
+ ec = TALER_JSON_get_error_code (j);
/* This should never happen, either us or the exchange is buggy
(or API version conflict); just pass JSON reply to the application */
break;
case MHD_HTTP_NOT_FOUND:
+ ec = TALER_JSON_get_error_code (j);
/* Nothing really to verify, exchange says this coin was not melted; we
should pass the JSON reply to the application */
break;
case MHD_HTTP_INTERNAL_SERVER_ERROR:
+ ec = TALER_JSON_get_error_code (j);
/* Server had an internal issue; we should retry, but this API
leaves this to the application */
break;
@@ -384,12 +389,13 @@ handle_link_finished (void *cls,
(unsigned int) response_code);
GNUNET_break (0);
response_code = 0;
+ ec = TALER_JSON_get_error_code (j);
break;
}
if (NULL != lh->link_cb)
lh->link_cb (lh->link_cb_cls,
response_code,
- TALER_JSON_get_error_code (j),
+ ec,
0,
NULL,
NULL,