Esempio n. 1
0
 /**
  * {@inheritdoc}
  */
 public function __construct($message = "", array $variables = null, $code = 0, Exception $previous = null)
 {
     if (!$code) {
         $code = $this->_code;
     }
     parent::__construct($message, $variables, $code, $previous);
     // 准备一个response对象
     $this->_response = new Response();
     $this->_response->status = $this->_code;
 }
Esempio n. 2
0
 /**
  * @param Validation $array   Validation对象
  * @param string     $message 错误信息
  * @param array      $values  翻译变量
  * @param int        $code    异常代码
  * @param Exception  $previous
  */
 public function __construct(Validation $array, $message = 'Failed to validate array', array $values = null, $code = 0, Exception $previous = null)
 {
     $this->array = $array;
     parent::__construct($message, $values, $code, $previous);
 }