aboutsummaryrefslogtreecommitdiff
path: root/src/wxBackend.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2016-11-19 17:37:39 +0100
committerFlorian Dold <florian.dold@gmail.com>2016-11-19 17:37:39 +0100
commit1357271717109f90ae510e3cc2d1ecaa94e55336 (patch)
tree5fe5e7939be1e8bbbee20f3222caf7f751a80bcb /src/wxBackend.ts
parent2cd4a85ed4c57a705e3aeb88052be616e0461187 (diff)
downloadwallet-core-1357271717109f90ae510e3cc2d1ecaa94e55336.tar.xz
missing files
Diffstat (limited to 'src/wxBackend.ts')
-rw-r--r--src/wxBackend.ts13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/wxBackend.ts b/src/wxBackend.ts
index 7893dd64d..6e637a2a6 100644
--- a/src/wxBackend.ts
+++ b/src/wxBackend.ts
@@ -392,6 +392,17 @@ function handleBankRequest(wallet: Wallet, headerList: chrome.webRequest.HttpHea
console.log("202 not understood (X-Taler-Callback-Url missing)");
return;
}
+ let amountParsed;
+ try {
+ amountParsed = JSON.parse(amount);
+ } catch (e) {
+ let uri = URI(chrome.extension.getURL("/src/pages/error.html"));
+ let p = {
+ message: `Can't parse amount ("${amount}"): ${e.message}`,
+ };
+ let redirectUrl = uri.query(p).href();
+ return {redirectUrl};
+ }
let wtTypes = headers["x-taler-wt-types"];
if (!wtTypes) {
console.log("202 not understood (X-Taler-Wt-Types missing)");
@@ -408,7 +419,7 @@ function handleBankRequest(wallet: Wallet, headerList: chrome.webRequest.HttpHea
let redirectUrl = uri.query(params).href();
return {redirectUrl};
}
- console.log("202 not understood");
+ // no known headers found, not a taler request ...
}
// Useful for debugging ...