commit e2d51b817edd8e1ccd0cd11f034ae224cbea428d
parent db7f59127b4c9be70cc64f2c05a0d419ae5b52f7
Author: Sebastian <sebasjm@taler-systems.com>
Date: Wed, 22 Jul 2026 14:29:26 -0300
consider keys not found
Diffstat:
2 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/packages/taler-util/src/http-client/exchange-client.ts b/packages/taler-util/src/http-client/exchange-client.ts
@@ -261,10 +261,7 @@ export class TalerExchangeHttpClient {
* https://docs.taler.net/core/api-exchange.html#get--config
*
*/
- async getConfig(): Promise<
- | OperationFail<HttpStatusCode.NotFound>
- | OperationOk<ExchangeVersionResponse>
- > {
+ async getConfig(){
const resp = await this.fetch("config");
switch (resp.status) {
case HttpStatusCode.Ok:
@@ -294,9 +291,13 @@ export class TalerExchangeHttpClient {
headers["cache-control"] = "no-cache";
}
const resp = await this.fetch("keys", { headers });
+ async getKeys() {
+ const resp = await this.fetch("keys");
switch (resp.status) {
case HttpStatusCode.Ok:
return opSuccessFromHttp(resp, codecForExchangeKeysResponse());
+ case HttpStatusCode.NotFound:
+ return opKnownHttpFailure(resp.status, resp);
default:
return opUnknownHttpFailure(resp);
}
diff --git a/packages/web-util/src/context/exchange-api.ts b/packages/web-util/src/context/exchange-api.ts
@@ -245,15 +245,15 @@ function buildExchangeApiClient(
}
}
const keysResp = await ex.getKeys();
- // if (keysResp.type === "fail") {
- // if (keysResp.detail) {
- // throw TalerError.fromUncheckedDetail(keysResp.detail);
- // } else {
- // throw TalerError.fromException(
- // new Error("failed to get exchange remote config"),
- // );
- // }
- // }
+ if (keysResp.type === "fail") {
+ if (keysResp.detail) {
+ throw TalerError.fromUncheckedDetail(keysResp.detail);
+ } else {
+ throw TalerError.fromException(
+ new Error("failed to get exchange remote config"),
+ );
+ }
+ }
return {
config: configResp.body,
keys: keysResp.body,