Fixing report timeout error message problem recently introduced when changed timeout process

This commit is contained in:
2022-01-19 19:50:53 +00:00
parent 64b10b3a03
commit c658d74ab8

View File

@@ -166,9 +166,17 @@ export default {
//check for any terminal status //check for any terminal status
if (jobStatus != 1 && jobStatus != 2) { if (jobStatus != 1 && jobStatus != 2) {
this.jobActive = false; this.jobActive = false;
// // eslint-disable-next-line no-debugger
// debugger;
const jobLogRes = await window.$gz.api.get( const jobLogRes = await window.$gz.api.get(
`job-operations/logs/${jobId}` `job-operations/logs/${jobId}`
); );
console.log("report error", {
jobStatus,
jobLogRes
});
//get final entry is error or success //get final entry is error or success
var finalJobLogMessage = jobLogRes.data[jobLogRes.data.length - 1]; var finalJobLogMessage = jobLogRes.data[jobLogRes.data.length - 1];
const finalJobLogObject = JSON.parse(finalJobLogMessage.statusText); const finalJobLogObject = JSON.parse(finalJobLogMessage.statusText);
@@ -181,6 +189,7 @@ export default {
e = this.$ay.t("JobFailed"); e = this.$ay.t("JobFailed");
} else { } else {
//failure of some kind, either timeout, exception or exception plus pagelog //failure of some kind, either timeout, exception or exception plus pagelog
if (finalJobLogObject.rendererror.timeout) { if (finalJobLogObject.rendererror.timeout) {
//timeout //timeout
await window.$gz.dialog.displayNoTranslationModalNotificationMessage( await window.$gz.dialog.displayNoTranslationModalNotificationMessage(
@@ -210,6 +219,10 @@ export default {
throw new Error(e); throw new Error(e);
} }
if (jobStatus == 3) { if (jobStatus == 3) {
//success or cancelled
//todo handle cancelled type of completed
//var json = Newtonsoft.Json.JsonConvert.SerializeObject(new { rendererror = new { cancelled = true} }, Newtonsoft.Json.Formatting.None);
if (!finalJobLogObject.reportfilename) { if (!finalJobLogObject.reportfilename) {
throw new Error( throw new Error(
`${this.$ay.t( `${this.$ay.t(