summaryrefslogtreecommitdiff
path: root/src/backend/taler-merchant-httpd_private-delete-products-ID.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-07-21 15:29:48 +0200
committerChristian Grothoff <christian@grothoff.org>2021-07-21 15:29:52 +0200
commit4c184f7e685817b565013c3afb2a5c30ecf10161 (patch)
treea4a6b777fc929b0e0017f887bcd80fcd441e094d /src/backend/taler-merchant-httpd_private-delete-products-ID.c
parent1e257c787a4344f242fd941dbfcdb957c7be4ba0 (diff)
downloadmerchant-4c184f7e685817b565013c3afb2a5c30ecf10161.tar.gz
merchant-4c184f7e685817b565013c3afb2a5c30ecf10161.tar.bz2
merchant-4c184f7e685817b565013c3afb2a5c30ecf10161.zip
-fix bugs, FTBFS
Diffstat (limited to 'src/backend/taler-merchant-httpd_private-delete-products-ID.c')
-rw-r--r--src/backend/taler-merchant-httpd_private-delete-products-ID.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/backend/taler-merchant-httpd_private-delete-products-ID.c b/src/backend/taler-merchant-httpd_private-delete-products-ID.c
index 2d17bafc..bb7964aa 100644
--- a/src/backend/taler-merchant-httpd_private-delete-products-ID.c
+++ b/src/backend/taler-merchant-httpd_private-delete-products-ID.c
@@ -40,6 +40,7 @@ TMH_private_delete_products_ID (const struct TMH_RequestHandler *rh,
enum GNUNET_DB_QueryStatus qs;
GNUNET_assert (NULL != mi);
+ GNUNET_assert (NULL != hc->infix);
qs = TMH_db->delete_product (TMH_db->cls,
mi->settings.id,
hc->infix);
@@ -49,18 +50,25 @@ TMH_private_delete_products_ID (const struct TMH_RequestHandler *rh,
return TALER_MHD_reply_with_error (connection,
MHD_HTTP_INTERNAL_SERVER_ERROR,
TALER_EC_GENERIC_DB_STORE_FAILED,
- NULL);
+ "delete_product");
case GNUNET_DB_STATUS_SOFT_ERROR:
GNUNET_break (0);
return TALER_MHD_reply_with_error (connection,
MHD_HTTP_INTERNAL_SERVER_ERROR,
TALER_EC_GENERIC_INTERNAL_INVARIANT_FAILURE,
- NULL);
+ "delete_product (soft)");
case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS:
+ /* check if deletion must have failed because of locks by
+ checking if the product exists */
qs = TMH_db->lookup_product (TMH_db->cls,
mi->settings.id,
hc->infix,
NULL);
+ if (GNUNET_DB_STATUS_HARD_ERROR == qs)
+ return TALER_MHD_reply_with_error (connection,
+ MHD_HTTP_INTERNAL_SERVER_ERROR,
+ TALER_EC_GENERIC_DB_STORE_FAILED,
+ "lookup_product");
if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs)
return TALER_MHD_reply_with_error (connection,
MHD_HTTP_NOT_FOUND,