Refactor the full treatment of the script call and error handling
Created by: Henrik tom Wörden
Whenever a sss is called the same treatment has to be done. This should be moved away from the single calls into the library.
Something like:
const result = await connection.runScript(
"ext_file_download/zip_files.py",
{"-p0": ids });
const code = result.getElementsByTagName("script")[0].getAttribute("code");
if (parseInt(code) > 0) {
throw ("An error occurred during execution of the server-side script:\n"
+ result.getElementsByTagName("script")[0].outerHTML);
}
const filename = result.getElementsByTagName("stdout")[0].textContent;
if (filename.length == 0) {
throw("Server-side script produced no file or did not return the file name: \n"
+ result.getElementsByTagName("script")[0].outerHTML);
}
The different kinds of logging have to be considered.
-
create library functions -
refactor code where this is done by hand
Imported comments:
By Henrik tom Wörden on 2020-11-13T12:10:37.843Z
mentioned in merge request !96 (merged)