Beispiel #1
0
 /**
  * handle script ending exception
  *
  * @param Exception that caused the failure
  * @param id of the task you started
  * @param exit code status of the process
  */
 protected function handleException(\Exception $e, $taskId, $exit)
 {
     $sub = '%s[ERROR]%s %s file: %s line: %d';
     // Remove Process Instance
     if ($e->getCode() != self::ERROR_SINGLE) {
         $this->removeProcessInstance();
     }
     // Update Failure
     if ($this->_isRecording && $taskId > 0) {
         $stdout = Output::getStdout();
         $stderr = Output::getStderr();
         //	Update Task w/ error messages
         $task = new \Models\Task();
         $task->updateFailed($taskId, $stdout, $stderr, $exit);
     }
     $msg = sprintf($sub, Output::COLOR_RED, Output::COLOR_NONE, $e->getMessage(), $e->getFile(), $e->getLine());
     // Let user that ran this know it failed
     Output::stderr($msg);
 }
Beispiel #2
0
 /**
  * handle script ending exception
  *
  * @param \Exception $e
  * @param $taskId
  * @param code $exit
  * @internal param that $Exception caused the failure
  * @internal param of $id the task you started
  * @internal param code $exit status of the process
  */
 protected function handleException(\Exception $e, $taskId, $exit)
 {
     $sub = '%s[ERROR]%s %s file: %s line: %d';
     // Remove Process Instance
     if ($e->getCode() != self::ERROR_SINGLE) {
         $this->removeProcessInstance();
     }
     $msg = sprintf($sub, Output::COLOR_RED, Output::COLOR_NONE, $e->getMessage(), $e->getFile(), $e->getLine());
     // Let user that ran this know it failed
     Output::stderr($msg);
 }