Hi all, is there a reason why JPPFClient#submitJob throws a plain Exception?
Looking at the code I couldn't find a reason. I'm using JPPF 4.2.
@Override
@SuppressWarnings("deprecation")
public List<Task<?>> submitJob(final JPPFJob job) throws Exception {
if (job == null) throw new IllegalArgumentException("job cannot be null");
if (job.client != null) {
if (!job.isDone()) throw new IllegalStateException("this job is already submitted");
job.cancelled.set(false);
job.getResults().clear();
}
job.client = this;
if (job.getJobTasks().isEmpty()) throw new IllegalArgumentException("job cannot be empty");
if ((job.getResultListener() == null) ||
(job.isBlocking() && !(job.getResultListener() instanceof JPPFResultCollector))) job.setResultListener(new JPPFResultCollector(job));
SubmissionManager submissionManager = getSubmissionManager();
submissionManager.submitJob(job);
if (job.isBlocking()) return job.awaitResults();
return null;
}
All explicitly thrown exceptions seem to be runtime exceptions, and none of the other invoked methods throw Exception. This forces whoever is using the client to either catch Exception or declare to throw it, but in reality this is never happening. Unless there's something I'm not seeing, hence I'm asking.
Thanks.