/// <summary> /// Saves the job to a persisted store. /// </summary> /// <param name="job">Job2 type job to persist.</param> /// <param name="definition">Job definition containing source adapter information.</param> public void PersistJob(Job2 job, JobDefinition definition) { if (job == null) { throw new PSArgumentNullException("job"); } if (definition == null) { throw new PSArgumentNullException("definition"); } JobSourceAdapter sourceAdapter = GetJobSourceAdapter(definition); try { sourceAdapter.PersistJob(job); } catch (Exception exception) { // Since we are calling into 3rd party code // catching Exception is allowed. In all // other cases the appropriate exception // needs to be caught. // sourceAdapter.NewJob returned unknown error. _tracer.TraceException(exception); throw; } }
public void PersistJob(Job2 job, JobDefinition definition) { if (job == null) { throw new PSArgumentNullException("job"); } if (definition == null) { throw new PSArgumentNullException("definition"); } JobSourceAdapter jobSourceAdapter = this.GetJobSourceAdapter(definition); try { jobSourceAdapter.PersistJob(job); } catch (Exception exception) { this.Tracer.TraceException(exception); CommandProcessorBase.CheckForSevereException(exception); throw; } }