From e259d109efd998d0ff6197123a47b83bfe274680 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Tue, 3 Nov 2020 13:46:44 +0100 Subject: fix CheckPaymentPaidResponse schema --- packages/taler-wallet-core/src/util/codec.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'packages/taler-wallet-core/src/util') diff --git a/packages/taler-wallet-core/src/util/codec.ts b/packages/taler-wallet-core/src/util/codec.ts index 4654c8b93..8605ff335 100644 --- a/packages/taler-wallet-core/src/util/codec.ts +++ b/packages/taler-wallet-core/src/util/codec.ts @@ -341,10 +341,17 @@ export function codecForConstString(s: V): Codec { if (x === s) { return x; } + if (typeof x !== "string") { + throw new DecodingError( + `expected string constant "${s}" at ${renderContext( + c, + )} but got ${typeof x}`, + ); + } throw new DecodingError( `expected string constant "${s}" at ${renderContext( c, - )} but got ${typeof x}`, + )} but got string value "${x}"`, ); }, }; -- cgit v1.2.3