Commit 2f491e2b authored by Daniel's avatar Daniel

ENH: Better error handling in ext_server_side.js

parent 256a3ef2
......@@ -39,6 +39,12 @@ async function downloadXLS() {
xls_result = await connection.runScript("xls_from_csv.py",
{"urlencoded": csv_string}).catch(
(err) => { globalError(err); });
var code = xls_result.getElementsByTagName("script")[0].getAttribute("code");
if (parseInt(code) > 0) {
globalError("An error occurred during execution of the server-side script:\n"
+ xls_result.getElementsByTagName("script")[0].outerHTML);
throw "Sever-side scripting error.";
}
var filename = xls_result.getElementsByTagName("stdout")[0].textContent;
xls_link.setAttribute(
"href",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment