diff options
Diffstat (limited to 'src/backend/taler-merchant-httpd_private-post-reserves.c')
-rw-r--r-- | src/backend/taler-merchant-httpd_private-post-reserves.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/backend/taler-merchant-httpd_private-post-reserves.c b/src/backend/taler-merchant-httpd_private-post-reserves.c index ce50b24e..e2243936 100644 --- a/src/backend/taler-merchant-httpd_private-post-reserves.c +++ b/src/backend/taler-merchant-httpd_private-post-reserves.c @@ -192,22 +192,29 @@ handle_exchange (void *cls, rc); if (NULL == hr) { - rc->ec = TALER_EC_TIMEOUT; - rc->http_status = MHD_HTTP_REQUEST_TIMEOUT; + rc->ec = TALER_EC_MERCHANT_GENERIC_EXCHANGE_TIMEOUT; + rc->http_status = MHD_HTTP_GATEWAY_TIMEOUT; + TMH_trigger_daemon (); /* we resumed, kick MHD */ + return; + } + if (NULL == eh) + { + rc->ec = TALER_EC_MERCHANT_GENERIC_EXCHANGE_CONNECT_FAILURE; + rc->http_status = MHD_HTTP_BAD_GATEWAY; TMH_trigger_daemon (); /* we resumed, kick MHD */ return; } keys = TALER_EXCHANGE_get_keys (eh); if (NULL == keys) { - rc->ec = TALER_EC_KEYS_INVALID; - rc->http_status = MHD_HTTP_FAILED_DEPENDENCY; + rc->ec = TALER_EC_MERCHANT_GENERIC_EXCHANGE_KEYS_FAILURE; + rc->http_status = MHD_HTTP_BAD_GATEWAY; TMH_trigger_daemon (); /* we resumed, kick MHD */ return; } if (NULL == payto_uri) { - rc->ec = TALER_EC_RESERVES_POST_UNSUPPORTED_WIRE_METHOD; + rc->ec = TALER_EC_MERCHANT_PRIVATE_POST_RESERVES_UNSUPPORTED_WIRE_METHOD; rc->http_status = MHD_HTTP_CONFLICT; TMH_trigger_daemon (); /* we resumed, kick MHD */ return; @@ -301,8 +308,8 @@ TMH_private_post_reserves (const struct TMH_RequestHandler *rh, if (qs < 0) return TALER_MHD_reply_with_error (connection, MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_RESERVES_POST_DB_COMMIT_HARD_ERROR, - NULL); + TALER_EC_GENERIC_DB_STORE_FAILED, + "reserve"); return TALER_MHD_reply_json_pack (connection, MHD_HTTP_OK, "{s:o,s:s}", |