-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[HttpKernel] Throw a LogicException when kernel.exception does not lead to a Response #13780
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
nicolas-grekas
commented
Feb 24, 2015
Q | A |
---|---|
Bug fix? | no |
New feature? | no |
BC breaks? | no |
Deprecations? | no |
Tests pass? | yes |
Fixed tickets | - |
License | MIT |
Doc PR | - |
} | ||
} elseif (!$original || $isCritical) { | ||
error_log($message); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Useless once #13767 is merged since the importants exceptions will be thrown now, and we have an exception handler that is suited for the prod env
a8d2cbb
to
e821984
Compare
@@ -229,7 +229,7 @@ private function handleException(\Exception $e, $request, $type) | |||
if (!$event->hasResponse()) { | |||
$this->finishRequest($request, $type); | |||
|
|||
throw $e; | |||
throw new \LogicException('Handling "kernel.exception" events should led to a Response', 0, $e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the main goal of this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'Handling of the "kernel.exception" event should lead to a Response'
would be better.
Or perhaps 'No "kernel.exception" event listener created a Response'
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reworded the message to No listeners of the "kernel.exception" event set a Response
e821984
to
cb63767
Compare
👍 |
1 similar comment
👍 |
Thank you @nicolas-grekas. |
…ion does not lead to a Response (nicolas-grekas) This PR was merged into the 2.7 branch. Discussion ---------- [HttpKernel] Throw a LogicException when kernel.exception does not lead to a Response | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Commits ------- 22f4807 [HttpKernel] Throw a LogicException when kernel.exception does not led to a Response