/**
* @link Home
* @todo ..write a 404 page that actually makes sense.
*/
class HttpException
extends \RuntimeException
implements HttpExceptionInterface
{
public function __construct(
int $statusCode,
string $message = null,
\Exception $previous = null
) {
$this->statusCode = $statusCode;
parent::__construct($message, $code, $previous);
}
/**
* Get Status code.
*
* @return int Status code
*/
public function getStatusCode()
{
return $this->statusCode;
}
}
/**
* @link Home
* @todo ..write a 404 page that actually makes sense.
*/
throw new HttpException(400, 'Page Not Found');
/**
* @link Home
* @todo ..write a 404 page that actually makes sense.
*/
class HttpException extends \RuntimeException implements HttpExceptionInterface
{
public function __construct(int $statusCode, string $message = null, \Exception $previous = null)
{
$this->statusCode = $statusCode;
parent::__construct($message, $code, $previous);
}
/**
* Get Status code.
*
* @return int Status code
*/
public function getStatusCode()
{
return $this->statusCode;
}
}
/**
* @link Home
* @todo ..write a 404 page that actually makes sense.
*/
throw new HttpException(400, 'Page Not Found');