/** * 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); }
public function __construct() { parent::__construct(); header('HTTP/1.1 410 Gone', true, 410); }
public function __construct() { parent::__construct(); header('HTTP/1.1 401 Unauthorized', true, 401); header("WWW-Authenticate: {$this->type} realm=\"{$this->realm}\""); }
public function __construct() { parent::__construct(); header('HTTP/1.1 403 Forbidden', true, 403); }
public function __construct() { parent::__construct(); header('HTTP/1.1 501 Not Implemented', true, 501); }
public function __construct() { parent::__construct(); header('HTTP/1.1 500 Internal Server Error', true, 500); }
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); }