summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <grothoff@gnunet.org>2022-07-21 15:38:29 +0200
committerChristian Grothoff <grothoff@gnunet.org>2022-07-21 15:38:29 +0200
commit18eb19567bc6fff4d7d9ca165685192ef47bb6cc (patch)
treecc95f5f780d4bc894e957bacc58b420bcbbaed1f /src
parentcd9e788b32bd39837a6ff3dfeb80b482d8456448 (diff)
downloadmerchant-18eb19567bc6fff4d7d9ca165685192ef47bb6cc.tar.gz
merchant-18eb19567bc6fff4d7d9ca165685192ef47bb6cc.tar.bz2
merchant-18eb19567bc6fff4d7d9ca165685192ef47bb6cc.zip
-improve logging
Diffstat (limited to 'src')
-rw-r--r--src/backend/taler-merchant-httpd.c18
-rw-r--r--src/backend/taler-merchant-httpd_private-post-orders.c3
-rwxr-xr-xsrc/testing/test_merchant_instance_auth.sh2
3 files changed, 22 insertions, 1 deletions
diff --git a/src/backend/taler-merchant-httpd.c b/src/backend/taler-merchant-httpd.c
index 43e945b2..edf9589c 100644
--- a/src/backend/taler-merchant-httpd.c
+++ b/src/backend/taler-merchant-httpd.c
@@ -1376,10 +1376,15 @@ url_handler (void *cls,
return ret;
}
if (NULL == hc->rh)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "Endpoint `%s' not known\n",
+ hc->url);
return TALER_MHD_reply_with_error (connection,
MHD_HTTP_NOT_FOUND,
TALER_EC_GENERIC_ENDPOINT_UNKNOWN,
hc->url);
+ }
}
}
/* At this point, we must have found a handler */
@@ -1389,6 +1394,9 @@ url_handler (void *cls,
if ( (NULL == hc->instance) &&
(! hc->rh->skip_instance) )
{
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "Instance `%s' not known\n",
+ hc->infix);
return TALER_MHD_reply_with_error (connection,
MHD_HTTP_NOT_FOUND,
TALER_EC_MERCHANT_GENERIC_INSTANCE_UNKNOWN,
@@ -1462,18 +1470,28 @@ url_handler (void *cls,
if ( (NULL == hc->instance) &&
(! hc->rh->skip_instance) )
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "Instance for URL `%s' not known\n",
+ url);
return TALER_MHD_reply_with_error (connection,
MHD_HTTP_NOT_FOUND,
TALER_EC_MERCHANT_GENERIC_INSTANCE_UNKNOWN,
url);
+ }
if ( (NULL != hc->instance) && /* make static analysis happy */
(! hc->rh->skip_instance) &&
(hc->instance->deleted) &&
(! hc->rh->allow_deleted_instance) )
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "Instance `%s' was deleted\n",
+ hc->instance->settings.id);
return TALER_MHD_reply_with_error (connection,
MHD_HTTP_NOT_FOUND,
TALER_EC_MERCHANT_GENERIC_INSTANCE_DELETED,
hc->instance->settings.id);
+ }
/* parse request body */
hc->has_body = ( (0 == strcasecmp (method,
MHD_HTTP_METHOD_POST)) ||
diff --git a/src/backend/taler-merchant-httpd_private-post-orders.c b/src/backend/taler-merchant-httpd_private-post-orders.c
index 5444222b..bb64fb02 100644
--- a/src/backend/taler-merchant-httpd_private-post-orders.c
+++ b/src/backend/taler-merchant-httpd_private-post-orders.c
@@ -1351,6 +1351,9 @@ merge_inventory (struct MHD_Connection *connection,
ec = TALER_EC_GENERIC_DB_SOFT_FAILURE;
break;
case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS:
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "Product %s from order unknown\n",
+ inventory_products[i].product_id);
http_status = MHD_HTTP_NOT_FOUND;
ec = TALER_EC_MERCHANT_GENERIC_PRODUCT_UNKNOWN;
break;
diff --git a/src/testing/test_merchant_instance_auth.sh b/src/testing/test_merchant_instance_auth.sh
index 109f4eae..4ba4fc0e 100755
--- a/src/testing/test_merchant_instance_auth.sh
+++ b/src/testing/test_merchant_instance_auth.sh
@@ -20,7 +20,7 @@
. initialize_taler_system.sh
-echo -n "Configuring default instance ..."
+echo -n "Configuring 'default' instance ..."
STATUS=$(curl -H "Content-Type: application/json" -X POST \
http://localhost:9966/management/instances \