summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/util
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2020-11-03 13:46:44 +0100
committerFlorian Dold <florian@dold.me>2020-11-03 13:47:02 +0100
commite259d109efd998d0ff6197123a47b83bfe274680 (patch)
tree29e4d7d9f1dca803252acd10316ca71f1c4cf90e /packages/taler-wallet-core/src/util
parent7008de598db1088f5f6b23b9aafb1e406b66ada2 (diff)
downloadwallet-core-e259d109efd998d0ff6197123a47b83bfe274680.tar.gz
wallet-core-e259d109efd998d0ff6197123a47b83bfe274680.tar.bz2
wallet-core-e259d109efd998d0ff6197123a47b83bfe274680.zip
fix CheckPaymentPaidResponse schema
Diffstat (limited to 'packages/taler-wallet-core/src/util')
-rw-r--r--packages/taler-wallet-core/src/util/codec.ts9
1 files changed, 8 insertions, 1 deletions
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<V extends string>(s: V): Codec<V> {
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}"`,
);
},
};