]> BookStack Code Mirror - bookstack/commitdiff
Fix "HTTP 500 on not found" bug #4290
authorThomas Kuschan <redacted>
Thu, 8 Jun 2023 08:50:12 +0000 (10:50 +0200)
committerThomas Kuschan <redacted>
Thu, 8 Jun 2023 08:50:12 +0000 (10:50 +0200)
app/Exceptions/Handler.php

index f2672cf5778a11e13046be41ca99a65a66ca2ae3..00122c15ad4b54fb626ec5487d02759dff499b17 100644 (file)
@@ -79,7 +79,7 @@ class Handler extends ExceptionHandler
      */
     protected function renderApiException(Throwable $e): JsonResponse
     {
-        $code = 500;
+        $code = $e->getCode() === 0 ? 500 : $e->getCode();
         $headers = [];
 
         if ($e instanceof HttpException) {
Morty Proxy This is a proxified and sanitized view of the page, visit original site.