diff options
Diffstat (limited to 'src/exchange/taler-exchange-httpd_melt.c')
-rw-r--r-- | src/exchange/taler-exchange-httpd_melt.c | 47 |
1 files changed, 23 insertions, 24 deletions
diff --git a/src/exchange/taler-exchange-httpd_melt.c b/src/exchange/taler-exchange-httpd_melt.c index 872389543..8b5914e2d 100644 --- a/src/exchange/taler-exchange-httpd_melt.c +++ b/src/exchange/taler-exchange-httpd_melt.c @@ -63,16 +63,16 @@ reply_melt_insufficient_funds ( if (NULL == history) return TALER_MHD_reply_with_error (connection, MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_MELT_HISTORY_DB_ERROR_INSUFFICIENT_FUNDS, + TALER_EC_EXCHANGE_MELT_HISTORY_DB_ERROR_INSUFFICIENT_FUNDS, NULL); return TALER_MHD_reply_json_pack ( connection, MHD_HTTP_CONFLICT, "{s:s, s:I, s:o, s:o, s:o, s:o, s:o}", "hint", - TALER_ErrorCode_get_hint (TALER_EC_MELT_INSUFFICIENT_FUNDS), + TALER_ErrorCode_get_hint (TALER_EC_EXCHANGE_MELT_INSUFFICIENT_FUNDS), "code", - (json_int_t) TALER_EC_MELT_INSUFFICIENT_FUNDS, + (json_int_t) TALER_EC_EXCHANGE_MELT_INSUFFICIENT_FUNDS, "coin_pub", GNUNET_JSON_from_data_auto (coin_pub), "original_value", @@ -115,7 +115,7 @@ reply_melt_success (struct MHD_Connection *connection, { return TALER_MHD_reply_with_error (connection, MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_EXCHANGE_BAD_CONFIGURATION, + TALER_EC_EXCHANGE_GENERIC_BAD_CONFIGURATION, "no keys"); } return TALER_MHD_reply_json_pack ( @@ -201,8 +201,8 @@ refresh_check_melt (struct MHD_Connection *connection, if (GNUNET_DB_STATUS_HARD_ERROR == qs) *mhd_ret = TALER_MHD_reply_with_error (connection, MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_MELT_DB_FETCH_ERROR, - NULL); + TALER_EC_GENERIC_DB_FETCH_FAILED, + "coin transaction history"); return qs; } if (rmc->zombie_required) @@ -228,7 +228,7 @@ refresh_check_melt (struct MHD_Connection *connection, tl); *mhd_ret = TALER_MHD_reply_with_error (connection, MHD_HTTP_BAD_REQUEST, - TALER_EC_MELT_COIN_EXPIRED_NO_ZOMBIE, + TALER_EC_EXCHANGE_MELT_COIN_EXPIRED_NO_ZOMBIE, NULL); return GNUNET_DB_STATUS_HARD_ERROR; } @@ -243,7 +243,7 @@ refresh_check_melt (struct MHD_Connection *connection, tl); *mhd_ret = TALER_MHD_reply_with_error (connection, MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_MELT_COIN_HISTORY_COMPUTATION_FAILED, + TALER_EC_EXCHANGE_MELT_COIN_HISTORY_COMPUTATION_FAILED, NULL); return GNUNET_DB_STATUS_HARD_ERROR; } @@ -349,8 +349,8 @@ melt_transaction (void *cls, if (GNUNET_DB_STATUS_HARD_ERROR == qs) *mhd_ret = TALER_MHD_reply_with_error (connection, MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_MELT_DB_FETCH_ERROR, - NULL); + TALER_EC_GENERIC_DB_FETCH_FAILED, + "melt index"); return qs; } @@ -375,8 +375,8 @@ melt_transaction (void *cls, { *mhd_ret = TALER_MHD_reply_with_error (connection, MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_MELT_DB_STORE_SESSION_ERROR, - NULL); + TALER_EC_GENERIC_DB_STORE_FAILED, + "melt"); return GNUNET_DB_STATUS_HARD_ERROR; } return qs; @@ -425,7 +425,7 @@ handle_melt (struct MHD_Connection *connection, GNUNET_break_op (0); return TALER_MHD_reply_with_error (connection, MHD_HTTP_FORBIDDEN, - TALER_EC_MELT_COIN_SIGNATURE_INVALID, + TALER_EC_EXCHANGE_MELT_COIN_SIGNATURE_INVALID, NULL); } } @@ -470,7 +470,7 @@ check_for_denomination_key (struct MHD_Connection *connection, TALER_LOG_ERROR ("Lacking keys to operate\n"); return TALER_MHD_reply_with_error (connection, MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_EXCHANGE_BAD_CONFIGURATION, + TALER_EC_EXCHANGE_GENERIC_BAD_CONFIGURATION, "no keys"); } @@ -517,8 +517,8 @@ check_for_denomination_key (struct MHD_Connection *connection, GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR != qs); return TALER_MHD_reply_with_error (connection, MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_MELT_DB_FETCH_ERROR, - NULL); + TALER_EC_GENERIC_DB_FETCH_FAILED, + "coin denomination"); } /* sanity check */ GNUNET_break (0 == @@ -572,12 +572,11 @@ check_for_denomination_key (struct MHD_Connection *connection, { GNUNET_break_op (0); TEH_KS_release (key_state); - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_BAD_REQUEST, - TALER_EC_MELT_CURRENCY_MISMATCH, - rmc->refresh_session.amount_with_fee. - currency); - + return TALER_MHD_reply_with_error ( + connection, + MHD_HTTP_BAD_REQUEST, + TALER_EC_GENERIC_CURRENCY_MISMATCH, + rmc->refresh_session.amount_with_fee.currency); } /* check coin is actually properly signed */ if (GNUNET_OK != @@ -588,7 +587,7 @@ check_for_denomination_key (struct MHD_Connection *connection, TEH_KS_release (key_state); return TALER_MHD_reply_with_error (connection, MHD_HTTP_FORBIDDEN, - TALER_EC_MELT_DENOMINATION_SIGNATURE_INVALID, + TALER_EC_EXCHANGE_DENOMINATION_SIGNATURE_INVALID, NULL); } } @@ -602,7 +601,7 @@ check_for_denomination_key (struct MHD_Connection *connection, GNUNET_break_op (0); return TALER_MHD_reply_with_error (connection, MHD_HTTP_BAD_REQUEST, - TALER_EC_MELT_FEES_EXCEED_CONTRIBUTION, + TALER_EC_EXCHANGE_MELT_FEES_EXCEED_CONTRIBUTION, NULL); } return handle_melt (connection, |