Logging 2x, for otherwise silent failures in a) initial loadAllJobs(),

and b) subsequent manual executeJob()
This commit is contained in:
Michael Vorburger
2014-05-11 00:01:07 +02:00
parent 7f25cc3a91
commit b0132db815
@@ -108,8 +108,12 @@ public class JobRegisterServiceImpl implements JobRegisterService {
}
} catch (final Exception e) {
throw new PlatformInternalServerException("error.msg.sheduler.job.execution.failed", "Job execution failed for job with id:"
+ scheduledJobDetail.getId(), scheduledJobDetail.getId());
final String msg = "Job execution failed for job with id:"
+ scheduledJobDetail.getId();
logger.error(msg, e);
throw new PlatformInternalServerException(
"error.msg.sheduler.job.execution.failed", msg,
scheduledJobDetail.getId());
}
}
@@ -214,6 +218,9 @@ public class JobRegisterServiceImpl implements JobRegisterService {
scheduledJobDetails.updateNextRunTime(null);
final String stackTrace = getStackTraceAsString(throwable);
scheduledJobDetails.updateErrorLog(stackTrace);
logger.error(
"Could not schedule job: "
+ scheduledJobDetails.getJobName(), throwable);
}
scheduledJobDetails.updateCurrentlyRunningStatus(false);
}