aboutsummaryrefslogtreecommitdiff
path: root/src/pages
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2016-11-19 16:33:29 +0100
committerFlorian Dold <florian.dold@gmail.com>2016-11-19 16:33:29 +0100
commit2cd4a85ed4c57a705e3aeb88052be616e0461187 (patch)
tree7adf45ccda4eace9d350cb593ae19cd1151d300e /src/pages
parent50090b5fb44f9d3986064dfe9b6190b66cbe49bf (diff)
better error reporting
Diffstat (limited to 'src/pages')
-rw-r--r--src/pages/confirm-contract.html2
-rw-r--r--src/pages/confirm-create-reserve.html2
-rw-r--r--src/pages/confirm-create-reserve.tsx24
-rw-r--r--src/pages/logs.html2
-rw-r--r--src/pages/logs.tsx1
-rw-r--r--src/pages/tree.html2
6 files changed, 22 insertions, 11 deletions
diff --git a/src/pages/confirm-contract.html b/src/pages/confirm-contract.html
index 54a4d618d..261609d1c 100644
--- a/src/pages/confirm-contract.html
+++ b/src/pages/confirm-contract.html
@@ -16,7 +16,7 @@
<!-- <script src="/src/vendor/jed.js"></script> -->
<script src="/src/i18n.js"></script>
<script src="/src/i18n/strings.js"></script>
- <script src="/src/module-trampoline.js"></script>
+ <script src="/src/moduleTrampoline.js"></script>
<style>
button.accept {
diff --git a/src/pages/confirm-create-reserve.html b/src/pages/confirm-create-reserve.html
index c67c7e960..b679de9c9 100644
--- a/src/pages/confirm-create-reserve.html
+++ b/src/pages/confirm-create-reserve.html
@@ -17,7 +17,7 @@
<!-- module loading -->
<script src="/src/vendor/system-csp-production.src.js"></script>
- <script src="/src/module-trampoline.js"></script>
+ <script src="/src/moduleTrampoline.js"></script>
<style>
diff --git a/src/pages/confirm-create-reserve.tsx b/src/pages/confirm-create-reserve.tsx
index 963bd0697..81a90650c 100644
--- a/src/pages/confirm-create-reserve.tsx
+++ b/src/pages/confirm-create-reserve.tsx
@@ -374,14 +374,24 @@ class ExchangeSelection extends ImplicitStateComponent<ExchangeSelectionProps> {
}
export async function main() {
- const url = URI(document.location.href);
- const query: any = URI.parseQuery(url.query());
- const amount = AmountJson.checked(JSON.parse(query.amount));
- const callback_url = query.callback_url;
- const bank_url = query.bank_url;
- const wt_types = JSON.parse(query.wt_types);
-
try {
+ const url = URI(document.location.href);
+ const query: any = URI.parseQuery(url.query());
+ let amount;
+ try {
+ amount = AmountJson.checked(JSON.parse(query.amount));
+ } catch (e) {
+ throw Error(`Can't parse amount: ${e.message}`);
+ }
+ const callback_url = query.callback_url;
+ const bank_url = query.bank_url;
+ let wt_types;
+ try {
+ wt_types = JSON.parse(query.wt_types);
+ } catch (e) {
+ throw Error(`Can't parse wire_types: ${e.message}`);
+ }
+
const suggestedExchangeUrl = await getSuggestedExchange(amount.currency);
let args = {
wt_types,
diff --git a/src/pages/logs.html b/src/pages/logs.html
index 8d35bcbd7..9178298f8 100644
--- a/src/pages/logs.html
+++ b/src/pages/logs.html
@@ -19,7 +19,7 @@
<script src="/src/i18n/strings.js"></script>
<script src="/src/vendor/system-csp-production.src.js"></script>
- <script src="/src/module-trampoline.js"></script>
+ <script src="/src/moduleTrampoline.js"></script>
<style>
.tree-item {
diff --git a/src/pages/logs.tsx b/src/pages/logs.tsx
index 126659fe7..15bb3d270 100644
--- a/src/pages/logs.tsx
+++ b/src/pages/logs.tsx
@@ -38,6 +38,7 @@ class LogView extends React.Component<LogViewProps, void> {
<li>file: {e.source || "(unknown)"}</li>
<li>line: {e.line || "(unknown)"}</li>
<li>col: {e.col || "(unknown)"}</li>
+ {(e.detail ? <li> detail: <pre>{e.detail}</pre></li> : [])}
</ul>
</div>
);
diff --git a/src/pages/tree.html b/src/pages/tree.html
index 306044159..4be7a5cdc 100644
--- a/src/pages/tree.html
+++ b/src/pages/tree.html
@@ -19,7 +19,7 @@
<script src="/src/i18n/strings.js"></script>
<script src="/src/vendor/system-csp-production.src.js"></script>
- <script src="/src/module-trampoline.js"></script>
+ <script src="/src/moduleTrampoline.js"></script>
<style>
.tree-item {