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}`
);
//get final entry is error or success
var finalEntry = jobLogRes.data[jobLogRes.data.length - 1];
const finalEntryObject = JSON.parse(finalEntry.statusText);
var finalJobLogMessage = jobLogRes.data[jobLogRes.data.length - 1];
const finalJobLogObject = JSON.parse(finalJobLogMessage.statusText);
if (jobStatus == 4 || jobStatus == 0) {
var e = null;
//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
e = this.$ay.t("JobFailed");
} else {
//failure of some kind, either timeout, exception or exception plus pagelog
if (finalEntryObject.rendererror.timeout) {
if (finalJobLogObject.rendererror.timeout) {
//timeout
await window.$gz.dialog.displayNoTranslationModalNotificationMessage(
window.$gz.translation
.get("ReportRenderTimeOut")
.replace(
"{0}",
finalEntryObject.rendererror.timeoutsetting
finalJobLogObject.rendererror.timeoutsetting
),
null,
"error",
@@ -205,17 +205,17 @@ export default {
} else {
//exception
e = `${this.$ay.t("JobFailed")}: ${
finalEntryObject.rendererror.exception
finalJobLogObject.rendererror.exception
}`;
if (finalEntryObject.rendererror.pagelog) {
e += "\n---------\n" + finalEntryObject.rendererror.pagelog;
if (finalJobLogObject.rendererror.pagelog) {
e += "\n---------\n" + finalJobLogObject.rendererror.pagelog;
}
}
}
throw new Error(e);
}
if (jobStatus == 3) {
if (!finalEntryObject.reportfilename) {
if (!finalJobLogObject.reportfilename) {
throw new Error(
`${this.$ay.t(
"JobCompleted"
@@ -223,7 +223,7 @@ export default {
);
}
var reportUrl = window.$gz.api.reportDownloadUrl(
o.reportfilename
finalJobLogObject.reportfilename
);
if (window.open(reportUrl, "Report") == null) {
this.reject(