code: public JobExecutionResult toJobExecutionResult(ClassLoader classLoader) throws JobExecutionException, IOException, ClassNotFoundException {
  		if (applicationStatus == ApplicationStatus.SUCCEEDED) {
  			return new JobExecutionResult(
  				jobId,
  				netRuntime,
  				AccumulatorHelper.deserializeAccumulators(
  					accumulatorResults,
  					classLoader));
  		} else {
  			final Throwable cause;
  
  			if (serializedThrowable == null) {
  				cause = null;
  			} else {
  				cause = serializedThrowable.deserializeError(classLoader);
  			}
  
  			final JobExecutionException exception;
  
  			if (applicationStatus == ApplicationStatus.FAILED) {
  				exception = new JobExecutionException(jobId, "Job execution failed.", cause);
  			} else if (applicationStatus == ApplicationStatus.CANCELED) {
  				exception = new JobCancellationException(jobId, "Job was cancelled.", cause);
  			} else {
  				exception = new JobExecutionException(jobId, "Job completed with illegal application status: " + applicationStatus + '.', cause);
  			}
  
  			throw exception;
  		}
  	}
docs: Converts the {@link JobResult} to a {@link JobExecutionResult}.
  
  @param classLoader to use for deserialization
  @return JobExecutionResult
  @throws JobCancellationException if the job was cancelled
  @throws JobExecutionException if the job execution did not succeed
  @throws IOException if the accumulator could not be deserialized
  @throws ClassNotFoundException if the accumulator could not deserialized