diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-04-04 13:27:46 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-04-04 13:27:46 +0200 |
commit | 299b4b78e0e4b8f194d0f0db18e22b540b174b88 (patch) | |
tree | bee0cf9a0e984926e1af69269d745974176ce945 /src/include | |
parent | 643b3e3be3e5aff3fe4074e27d867605c18cb0dc (diff) | |
download | exchange-299b4b78e0e4b8f194d0f0db18e22b540b174b88.tar.xz |
return more error details for /wire and /keys to clients
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/taler_error_codes.h | 6 | ||||
-rw-r--r-- | src/include/taler_exchange_service.h | 12 | ||||
-rw-r--r-- | src/include/taler_testing_lib.h | 8 |
3 files changed, 23 insertions, 3 deletions
diff --git a/src/include/taler_error_codes.h b/src/include/taler_error_codes.h index ce75cf6ac..7bdbd573a 100644 --- a/src/include/taler_error_codes.h +++ b/src/include/taler_error_codes.h @@ -112,6 +112,12 @@ enum TALER_ErrorCode TALER_EC_WRONG_NUMBER_OF_SEGMENTS = 12, /** + * The start and end-times in the wire fee structure leave a hole. + * This is not allowed. Generated as an error on the client-side. + */ + TALER_EC_HOLE_IN_WIRE_FEE_STRUCTURE = 13, + + /** * The exchange failed to even just initialize its connection to the * database. This response is provided with HTTP status code * #MHD_HTTP_INTERNAL_SERVER_ERROR. diff --git a/src/include/taler_exchange_service.h b/src/include/taler_exchange_service.h index e935c9196..5f7cf6033 100644 --- a/src/include/taler_exchange_service.h +++ b/src/include/taler_exchange_service.h @@ -359,12 +359,18 @@ enum TALER_EXCHANGE_VersionCompatibility * @param keys information about the various keys used * by the exchange, NULL if /keys failed * @param compat protocol compatibility information + * @param ec error code, #TALER_EC_NONE on success + * @param http_status status returned by /keys, #MHD_HTTP_OK on success + * @param full_reply JSON body of /keys request, NULL if reply was not in JSON */ typedef void (*TALER_EXCHANGE_CertificationCallback) ( void *cls, const struct TALER_EXCHANGE_Keys *keys, - enum TALER_EXCHANGE_VersionCompatibility compat); + enum TALER_EXCHANGE_VersionCompatibility compat, + enum TALER_ErrorCode ec, + unsigned int http_status, + const json_t *full_reply); /** @@ -649,6 +655,7 @@ struct TALER_EXCHANGE_WireAccount * @param ec taler-specific error code, #TALER_EC_NONE on success * @param accounts_len length of the @a accounts array * @param accounts list of wire accounts of the exchange, NULL on error + * @param full_reply the complete reply from the exchange (if it was in JSON) */ typedef void (*TALER_EXCHANGE_WireCallback) ( @@ -656,7 +663,8 @@ typedef void unsigned int http_status, enum TALER_ErrorCode ec, unsigned int accounts_len, - const struct TALER_EXCHANGE_WireAccount *accounts); + const struct TALER_EXCHANGE_WireAccount *accounts, + const json_t *full_reply); /** diff --git a/src/include/taler_testing_lib.h b/src/include/taler_testing_lib.h index c8949ee38..be20e0cd7 100644 --- a/src/include/taler_testing_lib.h +++ b/src/include/taler_testing_lib.h @@ -137,11 +137,17 @@ TALER_TESTING_prepare_exchange (const char *config_filename, * all the commands to be run, and a closure for it. * @param keys the exchange's keys. * @param compat protocol compatibility information. + * @param ec error code, #TALER_EC_NONE on success + * @param http_status status returned by /keys, #MHD_HTTP_OK on success + * @param full_reply JSON body of /keys request, NULL if reply was not in JSON */ void TALER_TESTING_cert_cb (void *cls, const struct TALER_EXCHANGE_Keys *keys, - enum TALER_EXCHANGE_VersionCompatibility compat); + enum TALER_EXCHANGE_VersionCompatibility compat, + enum TALER_ErrorCode ec, + unsigned int http_status, + const json_t *full_reply); /** |