diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-04-21 01:01:44 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-04-21 01:01:44 +0200 |
commit | cd5a980318d467206d30958073fa34fbb6a20f18 (patch) | |
tree | 41b9e6170832a3542a23356e1b49d778f39c7b39 /src/backend/taler-merchant-httpd_private-patch-products-ID.c | |
parent | 0b9a2ab6993b528dd5dab0beac9ec5c49d101bb9 (diff) |
-do not update total_sold when patching product, not provided as an argument, breaks invariants
Diffstat (limited to 'src/backend/taler-merchant-httpd_private-patch-products-ID.c')
-rw-r--r-- | src/backend/taler-merchant-httpd_private-patch-products-ID.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/backend/taler-merchant-httpd_private-patch-products-ID.c b/src/backend/taler-merchant-httpd_private-patch-products-ID.c index 47f695af..f9f7bc67 100644 --- a/src/backend/taler-merchant-httpd_private-patch-products-ID.c +++ b/src/backend/taler-merchant-httpd_private-patch-products-ID.c @@ -57,6 +57,7 @@ determine_cause (struct MHD_Connection *connection, switch (qs) { case GNUNET_DB_STATUS_HARD_ERROR: + GNUNET_break (0); return TALER_MHD_reply_with_error (connection, MHD_HTTP_INTERNAL_SERVER_ERROR, TALER_EC_GENERIC_DB_FETCH_FAILED, @@ -87,6 +88,7 @@ determine_cause (struct MHD_Connection *connection, if (pd->total_stock - pdx.total_sold < pd->total_lost) ec = TALER_EC_MERCHANT_PRIVATE_PATCH_PRODUCTS_TOTAL_LOST_EXCEEDS_STOCKS; TALER_MERCHANTDB_product_details_free (&pdx); + GNUNET_break (TALER_EC_GENERIC_INTERNAL_INVARIANT_FAILURE != ec); return TALER_MHD_reply_with_error (connection, MHD_HTTP_CONFLICT, ec, @@ -213,6 +215,7 @@ TMH_private_patch_products_ID (const struct TMH_RequestHandler *rh, switch (qs) { case GNUNET_DB_STATUS_HARD_ERROR: + GNUNET_break (0); ret = TALER_MHD_reply_with_error (connection, MHD_HTTP_INTERNAL_SERVER_ERROR, TALER_EC_GENERIC_DB_STORE_FAILED, |