From 9ba7d1e6c58c3730c343ea7730372f2890dbcfcc Mon Sep 17 00:00:00 2001 From: Thomas Kuschan Date: Thu, 8 Jun 2023 10:50:12 +0200 Subject: [PATCH] Fix "HTTP 500 on not found" bug #4290 --- app/Exceptions/Handler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) {