done.get(); done(done.getJob()); monitor.reportJobStatus(done.getJob().getId(), JobStatus.SUCCESS, null); } catch (CancellationException e) { sawError = true; monitor.reportJobStatus(done.getJob().getId(), JobStatus.CANCELLED, e); } catch (ExecutionException e) { sawError = true; Throwable cause = e.getCause(); if (cause instanceof InterruptedException) { monitor.reportJobStatus(done.getJob().getId(), JobStatus.CANCELLED, cause); cancelExecution(); throw (InterruptedException) cause; } else if (cause instanceof IOException) { monitor.reportJobStatus(done.getJob().getId(), JobStatus.FAILED, cause); handleException(done.getJob(), (IOException) cause); } else if (cause instanceof Error) { monitor.reportJobStatus(done.getJob().getId(), JobStatus.FAILED, cause); cancelExecution(); throw (Error) cause; } else if (cause instanceof RuntimeException) { monitor.reportJobStatus(done.getJob().getId(), JobStatus.FAILED, cause); cancelExecution(); throw (RuntimeException) cause; } else { monitor.reportJobStatus(done.getJob().getId(), JobStatus.FAILED, cause); cancelExecution(); throw new AssertionError(cause);