Skip to content

Commit 9ba7d1e

Browse files
committed
Fix "HTTP 500 on not found" bug BookStackApp#4290
1 parent ecf99fa commit 9ba7d1e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

app/Exceptions/Handler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ protected function isApiRequest(Request $request): bool
7979
*/
8080
protected function renderApiException(Throwable $e): JsonResponse
8181
{
82-
$code = 500;
82+
$code = $e->getCode() === 0 ? 500 : $e->getCode();
8383
$headers = [];
8484

8585
if ($e instanceof HttpException) {

0 commit comments

Comments
 (0)