merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

commit dbe8375ad9521036c43f3641dc10ed96e1ebba68
parent b2d26e8d0e5fcd048eeb2b8ae5bb026fa2fec8dc
Author: Christian Grothoff <grothoff@gnunet.org>
Date:   Thu, 29 Jan 2026 16:27:56 +0900

use correct exit codes

Diffstat:
Msrc/backend/taler-merchant-report-generator.c | 29+++++++++++++++++++----------
1 file changed, 19 insertions(+), 10 deletions(-)

diff --git a/src/backend/taler-merchant-report-generator.c b/src/backend/taler-merchant-report-generator.c @@ -266,7 +266,7 @@ finish_transmission (struct ReportActivity *ra, GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to update report status: %d\n", qs); - global_ret = 1; + global_ret = EXIT_FAILURE; GNUNET_SCHEDULER_shutdown (); return; } @@ -291,7 +291,7 @@ finish_transmission (struct ReportActivity *ra, (NULL == ra_head)) { GNUNET_log (GNUNET_ERROR_TYPE_INFO, - "Test mode, existing because of going idle\n"); + "Test mode, exiting because of going idle\n"); GNUNET_SCHEDULER_shutdown (); return; } @@ -667,7 +667,7 @@ check_pending_reports (void *cls) if (qs < 0) { GNUNET_break (0); - global_ret = 1; + global_ret = EXIT_FAILURE; GNUNET_SCHEDULER_shutdown (); return; } @@ -788,16 +788,25 @@ run (void *cls, (void) cfgfile; cfg = config; - if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (cfg, "merchant", "BASE_URL", &base_url)) { - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "BASE_URL not configured in section [merchant]\n"); - global_ret = 1; + GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, + "merchant", + "BASE_URL"); + global_ret = EXIT_NOTCONFIGURED; + return; + } + if (! TALER_is_web_url (base_url)) + { + GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR, + "merchant", + "BASE_URL", + "Not a Web URL"); + global_ret = EXIT_NOTCONFIGURED; return; } @@ -821,7 +830,7 @@ run (void *cls, if (NULL == curl_ctx) { GNUNET_break (0); - global_ret = 1; + global_ret = EXIT_FAILURE; GNUNET_SCHEDULER_shutdown (); return; } @@ -831,7 +840,7 @@ run (void *cls, if (NULL == db_plugin) { GNUNET_break (0); - global_ret = 1; + global_ret = EXIT_NOTINSTALLED; GNUNET_SCHEDULER_shutdown (); return; } @@ -859,7 +868,7 @@ run (void *cls, if (NULL == eh) { GNUNET_break (0); - global_ret = 1; + global_ret = EXIT_FAILURE; GNUNET_SCHEDULER_shutdown (); return; }