Beispiel #1
0
 /**
  * Internal method that checks if the CLI call has succeeded and throws an Excetion otherwise
  *
  * @param   CallResult  $result         The CLI result
  * @param   string      $message        The exception message
  */
 protected static function throwIfError(CallResult $result, $message)
 {
     if ($result->getReturnCode() > 0) {
         throw new CallException($message, $result);
     }
 }
Beispiel #2
0
 /**
  * Creates a new exception
  *
  * @param string        $message        The exception message
  * @param CallResult    $cliCallResult  The call result that caused the exception
  */
 public function __construct($message, CallResult $cliCallResult)
 {
     $this->cliCallResult = $cliCallResult;
     parent::__construct(sprintf($message . ' [%s]', $cliCallResult->getStdErr()), $cliCallResult->getReturnCode());
 }