Пример #1
0
 /**
  * Throw BadRequestException with HTTP 422 code
  *
  * @param array $errors
  */
 public function __construct(array $errors = [])
 {
     parent::__construct();
     header('HTTP/1.1 422 Bad Request', true, 422);
     if (!$errors) {
         return;
     }
     $this->showErrors($errors);
 }
Пример #2
0
 public function __construct()
 {
     parent::__construct();
     header('HTTP/1.1 410 Gone', true, 410);
 }
Пример #3
0
 public function __construct()
 {
     parent::__construct();
     header('HTTP/1.1 401 Unauthorized', true, 401);
     header("WWW-Authenticate: {$this->type} realm=\"{$this->realm}\"");
 }
Пример #4
0
 public function __construct()
 {
     parent::__construct();
     header('HTTP/1.1 403 Forbidden', true, 403);
 }
Пример #5
0
 public function __construct()
 {
     parent::__construct();
     header('HTTP/1.1 501 Not Implemented', true, 501);
 }
Пример #6
0
 public function __construct()
 {
     parent::__construct();
     header('HTTP/1.1 500 Internal Server Error', true, 500);
 }
Пример #7
0
 public function __construct()
 {
     parent::__construct();
     header('HTTP/1.1 404 Not Found', true, 404);
 }
 /**
  * @param string $message
  * @param int $code
  * @param \Exception|null $previous
  */
 public function __construct($message = "", $code = 0, \Exception $previous = null)
 {
     parent::__construct($this->getName() . ': ' . $message, 500);
 }