]> BookStack Code Mirror - bookstack/blobdiff - app/Exceptions/ApiAuthException.php
Opensearch: Fixed XML declaration when php short tags enabled
[bookstack] / app / Exceptions / ApiAuthException.php
index 360370de4109e723ed3446d5ff9de901fcc80556..070f7a8df0b9786e9937645a213d5ea16444a478 100644 (file)
@@ -2,6 +2,25 @@
 
 namespace BookStack\Exceptions;
 
-class ApiAuthException extends UnauthorizedException
+use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
+
+class ApiAuthException extends \Exception implements HttpExceptionInterface
 {
+    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 [];
+    }
 }