code: func (client *Client) PollJob(jobURL JobURL) (Warnings, error) {
  	var (
  		err         error
  		warnings    Warnings
  		allWarnings Warnings
  		job         Job
  	)
  
  	startTime := client.clock.Now()
  	for client.clock.Now().Sub(startTime) < client.jobPollingTimeout {
  		job, warnings, err = client.GetJob(jobURL)
  		allWarnings = append(allWarnings, warnings...)
  		if err != nil {
  			return allWarnings, err
  		}
  
  		if job.HasFailed() {
  			firstError := job.Errors()[0]
  			return allWarnings, firstError
  		}
  
  		if job.IsComplete() {
  			return allWarnings, nil
  		}
  
  		time.Sleep(client.jobPollingInterval)
  	}
  
  	return allWarnings, ccerror.JobTimeoutError{
  		JobGUID: job.GUID,
  		Timeout: client.jobPollingTimeout,
  	}
  }
docs: // PollJob will keep polling the given job until the job has terminated, an
  // error is encountered, or config.OverallPollingTimeout is reached. In the
  // last case, a JobTimeoutError is returned.