From 549c7f83d6af355c8b895b34c1fe30fba16b9049 Mon Sep 17 00:00:00 2001 From: Maxime Steinhausser Date: Sat, 26 Dec 2015 23:05:59 +0100 Subject: [PATCH] Fix ExceptionListener: exception to log isn't necessarily a BaseException instance --- EventListener/ExceptionListener.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/EventListener/ExceptionListener.php b/EventListener/ExceptionListener.php index b8446496a2..996c366f61 100644 --- a/EventListener/ExceptionListener.php +++ b/EventListener/ExceptionListener.php @@ -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 {