/** * Record an incident for a given job caused by an uncatched exception. This method is intended to record incidents by * the job system itself, e.g. the job dispatcher. */ private void unhandledException(Job job, String code, Severity severity, Throwable t) { if (!alreadyRecordedFailureIncident(job.getId())) { try { is.storeIncident( job, new Date(), code, severity, Collections.singletonMap("exception", ExceptionUtils.getMessage(t)), Arrays.asList(tuple("job-type", job.getJobType()), tuple("job-operation", job.getOperation()), tuple("stack-trace", ExceptionUtils.getStackTrace(t)))); } catch (IncidentServiceException e) { logException(e); } } }