diff options
author | Christian Grothoff <christian@grothoff.org> | 2024-01-15 13:22:59 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2024-01-15 13:22:59 +0100 |
commit | 993ed843fd7a1e51e4d47d7009dc484f237f45e9 (patch) | |
tree | 5648de0f577dca3569841c7d68cb38af12896b2a | |
parent | 510d4fc5234e8e17d73e8d95a0dc66ad37c03fef (diff) | |
download | exchange-993ed843fd7a1e51e4d47d7009dc484f237f45e9.tar.xz |
fix confusing error message
m--------- | contrib/wallet-core | 0 | ||||
-rw-r--r-- | src/exchangedb/plugin_exchangedb_postgres.c | 48 |
2 files changed, 28 insertions, 20 deletions
diff --git a/contrib/wallet-core b/contrib/wallet-core -Subproject 330edf879ab8f6fa4dbaf96de8ac84365c584e1 +Subproject a17a7a51dd50e2f508b078b9aada038fe124ff9 diff --git a/src/exchangedb/plugin_exchangedb_postgres.c b/src/exchangedb/plugin_exchangedb_postgres.c index 4e7bccbd2..b21e5d62f 100644 --- a/src/exchangedb/plugin_exchangedb_postgres.c +++ b/src/exchangedb/plugin_exchangedb_postgres.c @@ -234,14 +234,14 @@ * @param conn SQL connection that was used */ #define BREAK_DB_ERR(result,conn) do { \ - GNUNET_break (0); \ - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, \ - "Database failure: %s/%s/%s/%s/%s", \ - PQresultErrorField (result, PG_DIAG_MESSAGE_PRIMARY), \ - PQresultErrorField (result, PG_DIAG_MESSAGE_DETAIL), \ - PQresultErrorMessage (result), \ - PQresStatus (PQresultStatus (result)), \ - PQerrorMessage (conn)); \ + GNUNET_break (0); \ + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, \ + "Database failure: %s/%s/%s/%s/%s", \ + PQresultErrorField (result, PG_DIAG_MESSAGE_PRIMARY), \ + PQresultErrorField (result, PG_DIAG_MESSAGE_DETAIL), \ + PQresultErrorMessage (result), \ + PQresStatus (PQresultStatus (result)), \ + PQerrorMessage (conn)); \ } while (0) @@ -345,21 +345,29 @@ libtaler_plugin_exchangedb_postgres_init (void *cls) GNUNET_free (pg); return NULL; } - if ( (GNUNET_OK != - GNUNET_CONFIGURATION_get_value_time (cfg, - "exchangedb", - "IDLE_RESERVE_EXPIRATION_TIME", - &pg->idle_reserve_expiration_time)) - || - (GNUNET_OK != - GNUNET_CONFIGURATION_get_value_time (cfg, - "exchangedb", - "LEGAL_RESERVE_EXPIRATION_TIME", - &pg->legal_reserve_expiration_time)) ) + if (GNUNET_OK != + GNUNET_CONFIGURATION_get_value_time (cfg, + "exchangedb", + "IDLE_RESERVE_EXPIRATION_TIME", + &pg->idle_reserve_expiration_time)) + { + GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, + "exchangedb", + "IDLE_RESERVE_EXPIRATION_TIME"); + GNUNET_free (pg->exchange_url); + GNUNET_free (pg->sql_dir); + GNUNET_free (pg); + return NULL; + } + if (GNUNET_OK != + GNUNET_CONFIGURATION_get_value_time (cfg, + "exchangedb", + "LEGAL_RESERVE_EXPIRATION_TIME", + &pg->legal_reserve_expiration_time)) { GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, "exchangedb", - "LEGAL/IDLE_RESERVE_EXPIRATION_TIME"); + "LEGAL_RESERVE_EXPIRATION_TIME"); GNUNET_free (pg->exchange_url); GNUNET_free (pg->sql_dir); GNUNET_free (pg); |