case 4553

This commit is contained in:
2023-11-07 18:01:59 +00:00
parent 033e28cbf4
commit 50a70f8235

View File

@@ -173,13 +173,20 @@ export default {
//get final entry is error or success
var finalJobLogMessage = jobLogRes.data[jobLogRes.data.length - 1];
//bugbug: not all returns are json, if it's an error it could look like this:
//{"data":[{"created":"2023-10-26T20:28:12.88285Z","statusText":"LT:ProcessingJob \"LT:Report id: \"75\" LT:Customer (1) LT:User Marley Greenholt - BizAdmin - RenderReport\"","jobId":"600783fe-4253-482e-ad47-c4f892cc219e"},{"created":"2023-10-26T20:28:12.910591Z","statusText":"LT:BatchJob \"LT:Report id: \"75\" LT:Customer (1) LT:User Marley Greenholt - BizAdmin - RenderReport\" - LT:Failed ","jobId":"600783fe-4253-482e-ad47-c4f892cc219e"}]},
//Note in above that statusText isn't JSON it's just text, this was caused by an error at the server attempting to load the headless browser:
//2023-10-26 13:29:42.4213|ERROR|JobsBiz|ProcessJobAsync -> job failed LT:Report id: "75" LT:Customer (1) LT:User Marley Greenholt - BizAdmin - RenderReport=>PuppeteerSharp.ProcessException: Failed to launch browser! /var/ayanova/.local-chromium/Linux-970485/chrome-linux/chrome: error while loading shared libraries: libatk-1.0.so.0: cannot open shared object file: No such file or directory
const finalJobLogObject = JSON.parse(finalJobLogMessage.statusText);
//
//case 4553: not all returns are json
var finalJobLogObject = null;
try {
finalJobLogObject = JSON.parse(finalJobLogMessage.statusText);
} catch (parseError) {
if (finalJobLogMessage.statusText != null) {
throw new Error(
`${this.$ay.t("JobFailed")}: ${finalJobLogMessage.statusText}`
);
} else {
throw new Error(`${this.$ay.t("JobFailed")}`);
}
}
if (jobStatus == 4 || jobStatus == 0) {
var e = null;
@@ -251,6 +258,7 @@ export default {
}
} catch (error) {
this.jobActive = false;
this.reject(error);
}
},