commit a1574b823ac02956a268ffcf201c7b8ec40e674a
parent d5fae1b24b8275c60e35ff943e8cf5439d109f7e
Author: Florian Dold <florian@dold.me>
Date: Wed, 15 Jul 2026 18:39:59 +0200
-simplify
Diffstat:
1 file changed, 4 insertions(+), 11 deletions(-)
diff --git a/packages/taler-wallet-core/src/exchanges.ts b/packages/taler-wallet-core/src/exchanges.ts
@@ -113,6 +113,7 @@ import {
} from "@gnu-taler/taler-util";
import {
HttpRequestLibrary,
+ expectSuccessResponseOrThrow,
readResponseJsonOrThrow,
readSuccessResponseJsonOrThrow,
readTalerErrorResponse,
@@ -817,6 +818,8 @@ export type ExchangeKeysDownloadResult =
/**
* Download and validate an exchange's /keys data.
+ *
+ * FIXME: Use the HTTP client lib for this!
*/
async function downloadExchangeKeysInfo(
baseUrl: string,
@@ -839,17 +842,7 @@ async function downloadExchangeKeysInfo(
logger.trace("got response to /keys request");
- if (resp.status !== 200) {
- throw TalerError.fromDetail(
- TalerErrorCode.WALLET_UNEXPECTED_REQUEST_ERROR,
- {
- requestUrl: resp.requestUrl,
- requestMethod: resp.requestMethod,
- httpStatusCode: resp.status,
- },
- "Unexpected response status",
- );
- }
+ await expectSuccessResponseOrThrow(resp);
// We must make sure to parse out the protocol version
// before we validate the body.