diff --git a/packages/taler-wallet-cli/package.json b/packages/taler-wallet-cli/package.json index 5ad34c4c9..4f8952035 100644 --- a/packages/taler-wallet-cli/package.json +++ b/packages/taler-wallet-cli/package.json @@ -1,6 +1,6 @@ { "name": "@gnu-taler/taler-wallet-cli", - "version": "0.9.0-dev.1", + "version": "0.9.0-dev.2", "description": "", "engines": { "node": ">=0.12.0" diff --git a/packages/taler-wallet-cli/src/harness/harness.ts b/packages/taler-wallet-cli/src/harness/harness.ts index 07e298520..040bd5a6f 100644 --- a/packages/taler-wallet-cli/src/harness/harness.ts +++ b/packages/taler-wallet-cli/src/harness/harness.ts @@ -2035,13 +2035,19 @@ export class WalletCli { JSON.stringify(payload), )}`, ); + console.log("--- wallet core response ---"); console.log(resp); - const ar = JSON.parse(resp) as CoreApiResponse; + console.log("--- end of response ---"); + let ar: any; + try { + ar = JSON.parse(resp) as CoreApiResponse; + } catch (e) { + throw new Error("wallet CLI did not return a proper JSON response"); + } if (ar.type === "error") { throw new OperationFailedError(ar.error); - } else { - return ar.result; } + return ar.result; }, }; } diff --git a/packages/taler-wallet-core/src/operations/withdraw.ts b/packages/taler-wallet-core/src/operations/withdraw.ts index 8a492bd6e..8b72c40e8 100644 --- a/packages/taler-wallet-core/src/operations/withdraw.ts +++ b/packages/taler-wallet-core/src/operations/withdraw.ts @@ -998,10 +998,8 @@ export async function getExchangeWithdrawalInfo( baseUrl: string, amount: AmountJson, ): Promise { - const { - exchange, - exchangeDetails, - } = await ws.exchangeOps.updateExchangeFromUrl(ws, baseUrl); + const { exchange, exchangeDetails } = + await ws.exchangeOps.updateExchangeFromUrl(ws, baseUrl); await updateWithdrawalDenoms(ws, baseUrl); const denoms = await getCandidateWithdrawalDenoms(ws, baseUrl); const selectedDenoms = selectWithdrawalDenominations(amount, denoms);