]> BookStack Code Mirror - bookstack/blobdiff - app/Exceptions/ApiAuthException.php
respective book and chapter structure added.
[bookstack] / app / Exceptions / ApiAuthException.php
index 0851dfa4afdf8265d9ad69c962ff3d3d2701a1cb..070f7a8df0b9786e9937645a213d5ea16444a478 100644 (file)
@@ -2,16 +2,25 @@
 
 namespace BookStack\Exceptions;
 
-use Exception;
+use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
 
-class ApiAuthException extends Exception
+class ApiAuthException extends \Exception implements HttpExceptionInterface
 {
+    protected int $status;
 
-    /**
-     * ApiAuthException constructor.
-     */
-    public function __construct($message, $code = 401)
+    public function __construct(string $message, int $statusCode = 401)
     {
-        parent::__construct($message, $code);
+        $this->status = $statusCode;
+        parent::__construct($message, $statusCode);
     }
-}
\ No newline at end of file
+
+    public function getStatusCode(): int
+    {
+        return $this->status;
+    }
+
+    public function getHeaders(): array
+    {
+        return [];
+    }
+}