commit f1b329b668e0795726f0fa672b5b91fcc6986df6
parent 4c5f40781239ba295ade48854bc8e2f6228aa2ed
Author: Florian Dold <florian@dold.me>
Date: Sun, 24 Aug 2025 15:49:09 +0200
wallet-core: improve error reporting
Diffstat:
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/packages/taler-wallet-core/src/exchanges.ts b/packages/taler-wallet-core/src/exchanges.ts
@@ -966,7 +966,16 @@ async function downloadExchangeKeysInfo(
}
const protocolVersion = keysJson.version;
if (typeof protocolVersion !== "string") {
- throw Error("bad exchange, does not even specify protocol version");
+ throw TalerError.fromDetail(
+ TalerErrorCode.WALLET_RECEIVED_MALFORMED_RESPONSE,
+ {
+ requestUrl: resp.requestUrl,
+ requestMethod: resp.requestMethod,
+ httpStatusCode: resp.status,
+ validationError: "version field missing",
+ },
+ "bad exchange, does not even specify protocol version",
+ );
}
const versionRes = LibtoolVersion.compare(