From e42cf1a738aef2c2aee32997d157965b02e2fe0d Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 8 Nov 2020 00:50:16 +0100 Subject: adjust error codes in merchant --- .../taler-merchant-httpd_private-get-orders.c | 26 ++++++++++------------ 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'src/backend/taler-merchant-httpd_private-get-orders.c') diff --git a/src/backend/taler-merchant-httpd_private-get-orders.c b/src/backend/taler-merchant-httpd_private-get-orders.c index 8df4e69c..83ca09f9 100644 --- a/src/backend/taler-merchant-httpd_private-get-orders.c +++ b/src/backend/taler-merchant-httpd_private-get-orders.c @@ -272,7 +272,7 @@ add_order (void *cls, if (qs < 0) { GNUNET_break (0); - aos->result = TALER_EC_MERCHANT_PRIVATE_GET_ORDERS_STATUS_DB_LOOKUP_ERROR; + aos->result = TALER_EC_GENERIC_DB_FETCH_FAILED; return; } } @@ -304,7 +304,7 @@ add_order (void *cls, if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != qs) { GNUNET_break (0); - aos->result = TALER_EC_MERCHANT_PRIVATE_GET_ORDERS_CONTRACT_DB_LOOKUP_ERROR; + aos->result = TALER_EC_GENERIC_DB_FETCH_FAILED; json_decref (contract_terms); return; } @@ -329,7 +329,7 @@ add_order (void *cls, NULL, NULL)) { GNUNET_break (0); - aos->result = TALER_EC_MERCHANT_PRIVATE_GET_ORDERS_PARSE_CONTRACT_ERROR; + aos->result = TALER_EC_MERCHANT_GENERIC_DB_CONTRACT_CONTENT_INVALID; json_decref (contract_terms); return; } @@ -350,8 +350,7 @@ add_order (void *cls, if (0 > qs) { GNUNET_break (0); - aos->result = - TALER_EC_MERCHANT_PRIVATE_GET_ORDERS_REFUND_DB_LOOKUP_ERROR; + aos->result = TALER_EC_GENERIC_DB_FETCH_FAILED; json_decref (contract_terms); return; } @@ -497,7 +496,7 @@ TMH_private_get_orders (const struct TMH_RequestHandler *rh, &of.paid)) ) return TALER_MHD_reply_with_error (connection, MHD_HTTP_BAD_REQUEST, - TALER_EC_PARAMETER_MALFORMED, + TALER_EC_GENERIC_PARAMETER_MALFORMED, "paid"); if (! (TALER_arg_to_yna (connection, "refunded", @@ -505,7 +504,7 @@ TMH_private_get_orders (const struct TMH_RequestHandler *rh, &of.refunded)) ) return TALER_MHD_reply_with_error (connection, MHD_HTTP_BAD_REQUEST, - TALER_EC_PARAMETER_MALFORMED, + TALER_EC_GENERIC_PARAMETER_MALFORMED, "refunded"); if (! (TALER_arg_to_yna (connection, "wired", @@ -513,7 +512,7 @@ TMH_private_get_orders (const struct TMH_RequestHandler *rh, &of.wired)) ) return TALER_MHD_reply_with_error (connection, MHD_HTTP_BAD_REQUEST, - TALER_EC_PARAMETER_MALFORMED, + TALER_EC_GENERIC_PARAMETER_MALFORMED, "wired"); { const char *start_row_str; @@ -537,7 +536,7 @@ TMH_private_get_orders (const struct TMH_RequestHandler *rh, dummy)) return TALER_MHD_reply_with_error (connection, MHD_HTTP_BAD_REQUEST, - TALER_EC_PARAMETER_MALFORMED, + TALER_EC_GENERIC_PARAMETER_MALFORMED, "date"); of.start_row = (uint64_t) ull; } @@ -564,7 +563,7 @@ TMH_private_get_orders (const struct TMH_RequestHandler *rh, dummy)) return TALER_MHD_reply_with_error (connection, MHD_HTTP_BAD_REQUEST, - TALER_EC_PARAMETER_MALFORMED, + TALER_EC_GENERIC_PARAMETER_MALFORMED, "delta"); of.delta = (uint64_t) ll; } @@ -589,7 +588,7 @@ TMH_private_get_orders (const struct TMH_RequestHandler *rh, &of.date)) return TALER_MHD_reply_with_error (connection, MHD_HTTP_BAD_REQUEST, - TALER_EC_PARAMETER_MALFORMED, + TALER_EC_GENERIC_PARAMETER_MALFORMED, "date"); } } @@ -615,7 +614,7 @@ TMH_private_get_orders (const struct TMH_RequestHandler *rh, dummy)) return TALER_MHD_reply_with_error (connection, MHD_HTTP_BAD_REQUEST, - TALER_EC_PARAMETER_MALFORMED, + TALER_EC_GENERIC_PARAMETER_MALFORMED, "timeout_ms"); of.timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, ull); @@ -636,8 +635,7 @@ TMH_private_get_orders (const struct TMH_RequestHandler *rh, aos); if (0 > qs) { - aos->result = - TALER_EC_MERCHANT_PRIVATE_GET_ORDERS_BY_FILTER_DB_LOOKUP_ERROR; + aos->result = TALER_EC_GENERIC_DB_FETCH_FAILED; } if (TALER_EC_NONE != aos->result) { -- cgit v1.2.3