Пример #1
0
 /**
  * {@inheritDoc}
  */
 public function __construct($message, $code = 404)
 {
     if (is_array($message) && isset($message['message'])) {
         $this->_messageTemplate = $message['message'];
     }
     parent::__construct($message, $code);
 }
 public function __construct($message = null, $previous = null)
 {
     if ($message == null) {
         $message = 'AnnAuthorization error';
     }
     parent::__construct($message, 500, $previous);
 }
 /**
  * Constructor
  *
  * @param string $message If no message is given 'Site under maintenance'
  *  will be the message
  */
 public function __construct($message = null)
 {
     if (empty($message)) {
         $message = 'Site under maintenance';
     }
     parent::__construct($message, 503);
 }
Пример #4
0
 /**
  * Constructor
  *
  * @param string|null $message If no message is given 'Bad Request' will be the message
  * @param int $code Status code, defaults to 400
  */
 public function __construct($message = null, $code = 401)
 {
     $this->responseHeader('Access-Control-Allow-Origin', '*');
     if (empty($message)) {
         $message = 'Bad Request';
     }
     parent::__construct($message, $code);
 }
Пример #5
0
 /**
  * Constructor
  *
  * @param string $message Message string.
  * @param int $code Code.
  * @param string|null $file File name.
  * @param int|null $line Line number.
  */
 public function __construct($message, $code = 500, $file = null, $line = null)
 {
     parent::__construct($message, $code);
     if ($file) {
         $this->file = $file;
     }
     if ($line) {
         $this->line = $line;
     }
 }
Пример #6
0
 /**
  * {@inheritDoc}
  */
 public function __construct($message, $code = 404)
 {
     parent::__construct($message, $code);
 }
 /**
  * sets default code to 404
  *
  * @param string|array $message Either the string of the error message, or an array of attributes
  *   that are made available in the view, and sprintf()'d into Exception::$_messageTemplate
  * @param int $code The code of the error, is also the HTTP status code for the error.
  * @param \Exception $previous the previous exception.
  */
 public function __construct($message, $code = 404, $previous = null)
 {
     parent::__construct($message, $code, $previous);
 }
Пример #8
0
 /**
  * {@inheritDoc}
  */
 public function __construct($value, $expectedType, $code = 404)
 {
     $message = sprintf('Expected argument of type "%s", "%s" given.', $expectedType, gettype($value));
     parent::__construct($message, $code);
 }