2019-12-30 09:51:28 -05:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace BookStack\Exceptions;
|
|
|
|
|
2023-06-14 05:52:22 -04:00
|
|
|
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
|
|
|
|
|
|
|
|
class ApiAuthException extends \Exception implements HttpExceptionInterface
|
2021-03-07 17:24:05 -05:00
|
|
|
{
|
2023-06-14 05:52:22 -04:00
|
|
|
protected int $status;
|
|
|
|
|
|
|
|
public function __construct(string $message, int $statusCode = 401)
|
|
|
|
{
|
|
|
|
$this->status = $statusCode;
|
|
|
|
parent::__construct($message, $statusCode);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getStatusCode(): int
|
|
|
|
{
|
|
|
|
return $this->status;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getHeaders(): array
|
|
|
|
{
|
|
|
|
return [];
|
|
|
|
}
|
2021-03-07 17:24:05 -05:00
|
|
|
}
|