commit b2cc3873b7c2ee204a1c8baab23361ac8ec01d1e parent 50b11af6bcd9063aad561b804d4457d3a05a5ae4 Author: Christian Grothoff <grothoff@gnunet.org> Date: Sun, 19 Jul 2026 23:56:30 +0200 handle HTTP status codes as per spec Diffstat:
| M | src/lib/donau_api_donation_statement_get.c | | | 9 | +++++++++ |
1 file changed, 9 insertions(+), 0 deletions(-)
diff --git a/src/lib/donau_api_donation_statement_get.c b/src/lib/donau_api_donation_statement_get.c @@ -151,12 +151,21 @@ handle_donation_statement_get_finished (void *cls, dsresp.hr.ec = TALER_JSON_get_error_code (j); dsresp.hr.hint = TALER_JSON_get_error_hint (j); break; + case MHD_HTTP_NO_CONTENT: + /* No donation statement exists for the given year and donor; + this is a normal, non-error outcome (empty body). */ + break; case MHD_HTTP_INTERNAL_SERVER_ERROR: /* Server had an internal issue; we should retry, but this API leaves this to the application */ dsresp.hr.ec = TALER_JSON_get_error_code (j); dsresp.hr.hint = TALER_JSON_get_error_hint (j); break; + case MHD_HTTP_SERVICE_UNAVAILABLE: + /* The donau is lacking the keys to create the donation statement. */ + dsresp.hr.ec = TALER_JSON_get_error_code (j); + dsresp.hr.hint = TALER_JSON_get_error_hint (j); + break; default: /* unexpected response code */ GNUNET_break_op (0);