Skip to content

Commit

Permalink
Call prepare() on error responses (#43895)
Browse files Browse the repository at this point in the history
  • Loading branch information
tillkruss authored Aug 29, 2022
1 parent b32808d commit 45cd804
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Illuminate/Foundation/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ protected function shouldReturnJson($request, Throwable $e)
protected function prepareResponse($request, Throwable $e)
{
if (! $this->isHttpException($e) && config('app.debug')) {
return $this->toIlluminateResponse($this->convertExceptionToResponse($e), $e);
return $this->toIlluminateResponse($this->convertExceptionToResponse($e), $e)->prepare($request);
}

if (! $this->isHttpException($e)) {
Expand All @@ -539,7 +539,7 @@ protected function prepareResponse($request, Throwable $e)

return $this->toIlluminateResponse(
$this->renderHttpException($e), $e
);
)->prepare($request);
}

/**
Expand Down

1 comment on commit 45cd804

@diogoaguiar
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This broke our error response handling >.>

Please sign in to comment.