diff options
author | Florian Dold <florian@dold.me> | 2020-11-03 13:46:44 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2020-11-03 13:47:02 +0100 |
commit | e259d109efd998d0ff6197123a47b83bfe274680 (patch) | |
tree | 29e4d7d9f1dca803252acd10316ca71f1c4cf90e /packages/taler-wallet-core/src/util | |
parent | 7008de598db1088f5f6b23b9aafb1e406b66ada2 (diff) | |
download | wallet-core-e259d109efd998d0ff6197123a47b83bfe274680.tar.xz |
fix CheckPaymentPaidResponse schema
Diffstat (limited to 'packages/taler-wallet-core/src/util')
-rw-r--r-- | packages/taler-wallet-core/src/util/codec.ts | 9 |
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}"`, ); }, }; |