Commit 0740c8b7 authored by gmantele's avatar gmantele
Browse files

[UWS] Change phase to ERROR when a JobThread can not be created while starting a job.

parent 6f607bc6
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -119,7 +119,7 @@ import uws.service.log.UWSLog.LogLevel;
 * </ul>
 * 
 * @author	Gr&eacute;gory Mantelet (CDS;ARI)
 * @version	4.1 (10/2014)
 * @version	4.1 (11/2014)
 */
public class UWSJob extends SerializableUWSObject {
	private static final long serialVersionUID = 1L;
@@ -1151,9 +1151,14 @@ public class UWSJob extends SerializableUWSObject {
		}// Otherwise start directly the execution:
		else{
			// Create its corresponding thread:
			try{
				thread = getFactory().createJobThread(this);
				if (thread == null)
					throw new NullPointerException("Missing job work ! The thread created by the factory is NULL => The job can't be executed !");
			}catch(UWSException ue){
				setPhase(ExecutionPhase.ERROR);
				throw ue;
			}

			// Change the job phase:
			setPhase(ExecutionPhase.EXECUTING);