This commit is contained in:
2021-12-28 18:10:56 +00:00
parent 209fc2a663
commit 7c19424d64

View File

@@ -176,25 +176,25 @@ export default {
`job-operations/logs/${jobId}` `job-operations/logs/${jobId}`
); );
//get final entry is error or success //get final entry is error or success
var finalEntry = jobLogRes.data[jobLogRes.data.length - 1]; var finalJobLogMessage = jobLogRes.data[jobLogRes.data.length - 1];
const finalEntryObject = JSON.parse(finalEntry.statusText); const finalJobLogObject = JSON.parse(finalJobLogMessage.statusText);
if (jobStatus == 4 || jobStatus == 0) { if (jobStatus == 4 || jobStatus == 0) {
var e = null; var e = null;
//any error should be in a rendererror keyed object //any error should be in a rendererror keyed object
if (!finalEntryObject.rendererror) { if (!finalJobLogObject.rendererror) {
//unusual unknown error, shouldn't happen but just in case //unusual unknown error, shouldn't happen but just in case
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 (finalEntryObject.rendererror.timeout) { if (finalJobLogObject.rendererror.timeout) {
//timeout //timeout
await window.$gz.dialog.displayNoTranslationModalNotificationMessage( await window.$gz.dialog.displayNoTranslationModalNotificationMessage(
window.$gz.translation window.$gz.translation
.get("ReportRenderTimeOut") .get("ReportRenderTimeOut")
.replace( .replace(
"{0}", "{0}",
finalEntryObject.rendererror.timeoutsetting finalJobLogObject.rendererror.timeoutsetting
), ),
null, null,
"error", "error",
@@ -205,17 +205,17 @@ export default {
} else { } else {
//exception //exception
e = `${this.$ay.t("JobFailed")}: ${ e = `${this.$ay.t("JobFailed")}: ${
finalEntryObject.rendererror.exception finalJobLogObject.rendererror.exception
}`; }`;
if (finalEntryObject.rendererror.pagelog) { if (finalJobLogObject.rendererror.pagelog) {
e += "\n---------\n" + finalEntryObject.rendererror.pagelog; e += "\n---------\n" + finalJobLogObject.rendererror.pagelog;
} }
} }
} }
throw new Error(e); throw new Error(e);
} }
if (jobStatus == 3) { if (jobStatus == 3) {
if (!finalEntryObject.reportfilename) { if (!finalJobLogObject.reportfilename) {
throw new Error( throw new Error(
`${this.$ay.t( `${this.$ay.t(
"JobCompleted" "JobCompleted"
@@ -223,7 +223,7 @@ export default {
); );
} }
var reportUrl = window.$gz.api.reportDownloadUrl( var reportUrl = window.$gz.api.reportDownloadUrl(
o.reportfilename finalJobLogObject.reportfilename
); );
if (window.open(reportUrl, "Report") == null) { if (window.open(reportUrl, "Report") == null) {
this.reject( this.reject(