[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-merchant] branch master updated: use better status codes
From: |
gnunet |
Subject: |
[taler-merchant] branch master updated: use better status codes |
Date: |
Sun, 25 Oct 2020 20:09:26 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository merchant.
The following commit(s) were added to refs/heads/master by this push:
new 429456b use better status codes
429456b is described below
commit 429456b3188d0b0828b557553107ddfa83e8aa81
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sun Oct 25 20:09:23 2020 +0100
use better status codes
---
src/backend/taler-merchant-httpd_private-post-instances.c | 2 +-
src/backend/taler-merchant-httpd_private-post-orders.c | 4 ++--
src/lib/merchant_api_get_product.c | 4 ++++
src/lib/merchant_api_post_instances.c | 2 +-
src/testing/test_merchant_api.c | 4 ++--
5 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/src/backend/taler-merchant-httpd_private-post-instances.c
b/src/backend/taler-merchant-httpd_private-post-instances.c
index f703506..1a9d2b2 100644
--- a/src/backend/taler-merchant-httpd_private-post-instances.c
+++ b/src/backend/taler-merchant-httpd_private-post-instances.c
@@ -188,7 +188,7 @@ TMH_private_post_instances (const struct TMH_RequestHandler
*rh,
GNUNET_break_op (0);
GNUNET_JSON_parse_free (spec);
return TALER_MHD_reply_with_error (connection,
- MHD_HTTP_BAD_REQUEST,
+ MHD_HTTP_CONFLICT,
TALER_EC_POST_INSTANCES_BAD_CURRENCY,
NULL);
}
diff --git a/src/backend/taler-merchant-httpd_private-post-orders.c
b/src/backend/taler-merchant-httpd_private-post-orders.c
index 82e5e6c..840cc07 100644
--- a/src/backend/taler-merchant-httpd_private-post-orders.c
+++ b/src/backend/taler-merchant-httpd_private-post-orders.c
@@ -385,7 +385,7 @@ execute_order (struct MHD_Connection *connection,
GNUNET_JSON_parse_free (spec);
return TALER_MHD_reply_with_error (
connection,
- MHD_HTTP_BAD_REQUEST,
+ MHD_HTTP_CONFLICT,
TALER_EC_PROPOSAL_ORDER_BAD_CURRENCY,
TMH_currency);
}
@@ -464,7 +464,7 @@ execute_order (struct MHD_Connection *connection,
MHD_RESULT ret;
ret = TALER_MHD_reply_with_error (connection,
- MHD_HTTP_BAD_REQUEST, /* or
conflict? */
+ MHD_HTTP_CONFLICT,
TALER_EC_PROPOSAL_STORE_DB_ERROR_ALREADY_EXISTS,
order_id);
GNUNET_JSON_parse_free (spec);
diff --git a/src/lib/merchant_api_get_product.c
b/src/lib/merchant_api_get_product.c
index 076a694..0256076 100644
--- a/src/lib/merchant_api_get_product.c
+++ b/src/lib/merchant_api_get_product.c
@@ -173,6 +173,10 @@ handle_get_product_finished (void *cls,
GNUNET_JSON_parse_free (spec);
break;
}
+ case MHD_HTTP_NOT_FOUND:
+ hr.ec = TALER_JSON_get_error_code (json);
+ hr.hint = TALER_JSON_get_error_hint (json);
+ break;
default:
/* unexpected response code */
hr.ec = TALER_JSON_get_error_code (json);
diff --git a/src/lib/merchant_api_post_instances.c
b/src/lib/merchant_api_post_instances.c
index 503e31c..7b19c25 100644
--- a/src/lib/merchant_api_post_instances.c
+++ b/src/lib/merchant_api_post_instances.c
@@ -93,7 +93,7 @@ handle_post_instances_finished (void *cls,
iph->job = NULL;
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- "POST /instances completed with response code %u\n",
+ "POST /private/instances completed with response code %u\n",
(unsigned int) response_code);
switch (response_code)
{
diff --git a/src/testing/test_merchant_api.c b/src/testing/test_merchant_api.c
index 790bee4..c7348e8 100644
--- a/src/testing/test_merchant_api.c
+++ b/src/testing/test_merchant_api.c
@@ -328,7 +328,7 @@ run (void *cls,
NULL),
TALER_TESTING_cmd_merchant_post_orders ("create-proposal-1-pre-exists",
merchant_url,
- MHD_HTTP_BAD_REQUEST,
+ MHD_HTTP_CONFLICT,
"1",
GNUNET_TIME_UNIT_ZERO_ABS,
GNUNET_TIME_UNIT_FOREVER_ABS,
@@ -1241,7 +1241,7 @@ run (void *cls,
"i2",
PAYTO_I1,
"USD",
- MHD_HTTP_BAD_REQUEST),
+ MHD_HTTP_CONFLICT),
TALER_TESTING_cmd_merchant_post_instances ("instance-create-i2",
merchant_url,
"i2",
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-merchant] branch master updated: use better status codes,
gnunet <=