示例#1
0
文件: Base.php 项目: eveseat/eveapi
 /**
  * Update the JobTracker with a new status.
  *
  * @param array $data
  */
 public function updateJobStatus(array $data)
 {
     $this->job_tracker->fill($data);
     $this->job_tracker->save();
     return;
 }
示例#2
0
 /**
  * Write diagnostic information to the Job Tracker
  *
  * @param \Seat\Eveapi\Models\JobTracking $job_tracker
  * @param \Exception                      $e
  */
 public function reportJobError(JobTracking $job_tracker, \Exception $e)
 {
     // Write an entry to the log file.
     Log::error($job_tracker->api . '/' . $job_tracker->scope . ' for ' . $job_tracker->owner_id . ' failed with ' . get_class($e) . ': ' . $e->getMessage() . '. See the job tracker for more ' . 'information.');
     // Prepare some useful information about the error.
     $output = 'Last Updater: ' . $job_tracker->output . PHP_EOL;
     $output .= PHP_EOL;
     $output .= 'Exception: ' . get_class($e) . PHP_EOL;
     $output .= 'Error Code: ' . $e->getCode() . PHP_EOL;
     $output .= 'Error Message: ' . $e->getMessage() . PHP_EOL;
     $output .= 'File: ' . $e->getFile() . ' - Line: ' . $e->getLine() . PHP_EOL;
     $output .= PHP_EOL;
     $output .= 'Traceback: ' . $e->getTraceAsString() . PHP_EOL;
     $job_tracker->status = 'Error';
     $job_tracker->output = $output;
     $job_tracker->save();
     return;
 }