From a437605ebaf4267e60ae26f50ac107cdf11a8876 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Tue, 12 Sep 2023 08:52:14 +0200 Subject: [PATCH] taler-util: check status of merchant instances list response --- build-system/taler-build-scripts | 2 +- .../src/integrationtests/test-merchant-instances.ts | 1 - packages/taler-util/src/MerchantApiClient.ts | 3 ++- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build-system/taler-build-scripts b/build-system/taler-build-scripts index 001f5dd08..23538677f 160000 --- a/build-system/taler-build-scripts +++ b/build-system/taler-build-scripts @@ -1 +1 @@ -Subproject commit 001f5dd081fc8729ff8def90c4a1c3f93eb8689a +Subproject commit 23538677f6c6be2a62f38dc6137ecdd1c76b7b15 diff --git a/packages/taler-harness/src/integrationtests/test-merchant-instances.ts b/packages/taler-harness/src/integrationtests/test-merchant-instances.ts index fd7a8ca3a..27de8a0a0 100644 --- a/packages/taler-harness/src/integrationtests/test-merchant-instances.ts +++ b/packages/taler-harness/src/integrationtests/test-merchant-instances.ts @@ -193,7 +193,6 @@ export async function runMerchantInstancesTest(t: GlobalTestState) { }); console.log(exc); t.assertTrue(exc.errorDetail.httpStatusCode === 401); - t.assertDeepEqual(exc.response?.status, 401); } } diff --git a/packages/taler-util/src/MerchantApiClient.ts b/packages/taler-util/src/MerchantApiClient.ts index cbdcb9fdf..ccbbf79b3 100644 --- a/packages/taler-util/src/MerchantApiClient.ts +++ b/packages/taler-util/src/MerchantApiClient.ts @@ -14,6 +14,7 @@ GNU Taler; see the file COPYING. If not, see */ +import { codecForAny } from "./codec.js"; import { createPlatformHttpLib, expectSuccessResponseOrThrow, @@ -221,7 +222,7 @@ export class MerchantApiClient { const resp = await this.httpClient.fetch(url.href, { headers: this.makeAuthHeader(), }); - return resp.json(); + return readSuccessResponseJsonOrThrow(resp, codecForAny()); } async getInstanceFullDetails(instanceId: string): Promise {