Skip to content

Commit

Permalink
Fix ExceptionListener: exception to log isn't necessarily a BaseExcep…
Browse files Browse the repository at this point in the history
…tion instance
  • Loading branch information
ogizanagi committed Dec 27, 2015
1 parent 0d80068 commit 549c7f8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion EventListener/ExceptionListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,13 @@ public function showExceptionPageAction(FlattenException $exception)
*/
protected function logException(\Exception $exception, $message, $original = true)
{
if (!$exception instanceof BaseException) {
parent::logException($exception, $message, $original);

return;
}

if (null !== $this->logger) {
/** @var BaseException $exception */
if ($exception->getStatusCode() >= 500) {
$this->logger->critical($message, array('exception' => $exception));
} else {
Expand Down

0 comments on commit 549c7f8

Please sign in to comment.