From: Thomas Kuschan Date: Thu, 8 Jun 2023 08:50:12 +0000 (+0200) Subject: Fix "HTTP 500 on not found" bug #4290 X-Git-Tag: v23.06~1^2~20^2~3 X-Git-Url: http://source.bookstackapp.com/bookstack/commitdiff_plain/9ba7d1e6c58c3730c343ea7730372f2890dbcfcc?ds=sidebyside Fix "HTTP 500 on not found" bug #4290 --- diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index f2672cf57..00122c15a 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -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) {