Skip to content

NOW MANAGED ON CODEBERG

Fix "HTTP 500 on not found" bug #4290

Thomas Kuschan9ba7d1e6c58c
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) {