Modified IntervalErrorReportData

This commit is contained in:
Eugene Livis 2015-10-08 15:28:51 -04:00
parent 8b73207378
commit 343b0feeee

View File

@ -77,17 +77,18 @@ class IntervalErrorReportData implements SleuthkitCase.ErrorObserver {
* (or if this is the first problem encountered), a warning will be shown to * (or if this is the first problem encountered), a warning will be shown to
* the user. * the user.
* *
* @param newProblems the newProblems to set * @param newProblems the newProblems to set
* @param ex the exception for this error * @param context The context in which the error occurred.
* @param errorMessage A description of the error that occurred.
*/ */
private void addProblems(long newProblems, Exception ex) { private void addProblems(long newProblems, String context, String errorMessage) {
this.newProblems += newProblems; this.newProblems += newProblems;
this.totalProblems += newProblems; this.totalProblems += newProblems;
long currentTimeStamp = System.currentTimeMillis(); long currentTimeStamp = System.currentTimeMillis();
if ((currentTimeStamp - lastReportedDate) > milliSecondsBetweenReports) { if ((currentTimeStamp - lastReportedDate) > milliSecondsBetweenReports) {
this.lastReportedDate = currentTimeStamp; this.lastReportedDate = currentTimeStamp;
MessageNotifyUtil.Notify.error(message, ex.getMessage() + " " MessageNotifyUtil.Notify.error(message, context + ", " + errorMessage + " "
+ this.newProblems + " " + this.newProblems + " "
+ NbBundle.getMessage(IntervalErrorReportData.class, "IntervalErrorReport.NewIssues") + NbBundle.getMessage(IntervalErrorReportData.class, "IntervalErrorReport.NewIssues")
+ " " + this.totalProblems + " " + " " + this.totalProblems + " "
@ -98,7 +99,7 @@ class IntervalErrorReportData implements SleuthkitCase.ErrorObserver {
} }
@Override @Override
public void receiveError(Exception ex) { public void receiveError(String context, String errorMessage) {
addProblems(1, ex); addProblems(1, context, errorMessage);
} }
} }