aboutsummaryrefslogtreecommitdiff
path: root/src_js/common.js
diff options
context:
space:
mode:
Diffstat (limited to 'src_js/common.js')
-rw-r--r--src_js/common.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/src_js/common.js b/src_js/common.js
index bf1327a..1928624 100644
--- a/src_js/common.js
+++ b/src_js/common.js
@@ -26,6 +26,8 @@ export async function calculate() {
headers: {'Content-Type': 'application/json'},
body: JSON.stringify(params)
});
+ if (!res.ok)
+ throw await res.text();
const result = await res.json();
r.change(u.pipe(
u.set('result', result),
@@ -50,6 +52,8 @@ export async function generateOutput() {
headers: {'Content-Type': 'application/json'},
body: JSON.stringify(result)
});
+ if (!res.ok)
+ throw await res.text();
const blob = await res.blob();
FileSaver.saveAs(blob, 'output.pdf');
} catch (e) {