Skip to content

Commit

Permalink
show errors when generating report.
Browse files Browse the repository at this point in the history
related to #391
  • Loading branch information
tpokorra committed Sep 27, 2019
1 parent 118d5bd commit 0d4d00f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
10 changes: 8 additions & 2 deletions csharp/ICT/Petra/Server/lib/MReporting/core/Calculator.cs
Expand Up @@ -130,8 +130,16 @@ public TRptDataCalculator(String APathStandardReports, String APathCustomReports
ReturnValue = true;
}
}
catch (TargetInvocationException TExc)
{
TLogging.Log("TargetInvocationException in GenerateResult: ");
TLogging.Log(TExc.InnerException.Message);
AErrorMessage = TExc.InnerException.Message;
AException = TExc.InnerException;
}
catch (Exception Exc)
{
TLogging.Log("in GenerateResult");
TLogging.Log(Exc.ToString());
TLogging.Log(Exc.StackTrace);

Expand All @@ -140,8 +148,6 @@ public TRptDataCalculator(String APathStandardReports, String APathCustomReports
FParameters.Save(Path.GetDirectoryName(TSrvSetting.ServerLogFile) + Path.DirectorySeparatorChar + "LogAfterException.json");
}

Console.WriteLine(Exc.StackTrace);

AErrorMessage = Exc.Message;
AException = Exc;
}
Expand Down
15 changes: 12 additions & 3 deletions js-client/src/lib/reports.js
Expand Up @@ -92,9 +92,18 @@ function check_for_report(AReportID) {
if (!parsed.result.JobFinished) {
// console.log("Report progress: " + parsed.Caption + ' ' + parsed.StatusMessage);
setTimeout(function() { check_for_report(AReportID); }, 1000);
}
else {
print_report(AReportID);
} else {
api.post('serverMReporting.asmx/TReportGeneratorWebConnector_GetSuccess', r).then(function (data) {
parsed = JSON.parse(data.data.d);
if (parsed == true) {
print_report(AReportID);
} else {
api.post('serverMReporting.asmx/TReportGeneratorWebConnector_GetErrorMessage', r).then(function (data) {
display_message(i18next.t(data.data.d), "fail");
myPleaseWaitDiv.hidePleaseWait();
});
}
});
}
});
}
Expand Down

0 comments on commit 0d4d00f

Please sign in to comment.