Пример #1
0
 /**
  * Creates a new translated exception.
  *
  *     throw new Kohana_Exception('Something went terrible wrong, :user',
  *         array(':user' => $user));
  *
  * @param   string  $message    status message, custom content to display with error
  * @param   array   $variables  translation variables
  * @return  void
  */
 public function __construct($message = NULL, array $variables = NULL, Exception $previous = NULL, array $errors = NULL)
 {
     if ($errors) {
         $this->setErrors($errors);
     }
     if (method_exists($previous, 'getErrors')) {
         $this->setErrors($previous->getErrors());
     }
     parent::__construct($message, $variables, $previous);
 }
Пример #2
0
 /**
  * Creates a new translated exception.
  *
  *     throw new Kohana_Exception('Something went terrible wrong, :user',
  *         array(':user' => $user));
  *
  * @param   string $message   status message, custom content to display with error
  * @param   array  $variables translation variables
  *
  * @return  void
  */
 public function __construct($message = null, array $variables = null, Exception $previous = null)
 {
     parent::__construct($message, $variables, $previous);
     // Prepare our response object and set the correct status code.
     $this->_response = Response::factory()->status($this->_code);
 }
Пример #3
0
 public function __construct($message = null, array $variables = array(), Exception $previous = NULL, $code = 500)
 {
     parent::__construct($message, $variables, $previous);
     $this->code = $code;
 }
Пример #4
0
 public function __construct($message = NULL, array $variables = NULL, Exception $previous = NULL)
 {
     parent::__construct($message, $variables, $previous);
     $this->_response = Response::factory()->status($this->_code);
 }