From ad88a7d53d039207eddc82993920beab26375f62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Tue, 19 May 2015 12:35:22 +0200 Subject: [PATCH] exception class will be logged as well - helps especially in cases where the message contained is empty - e.g. "message":"OCP\\Files\\NotFoundException: at \/home\/deepdiver\/Development\/ownCloud\/core-autotest\/apps\/provisioning_api\/lib\/users.php#354", --- lib/private/log/errorhandler.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/private/log/errorhandler.php b/lib/private/log/errorhandler.php index b1b15f12ed..5e92db398f 100644 --- a/lib/private/log/errorhandler.php +++ b/lib/private/log/errorhandler.php @@ -64,10 +64,16 @@ class ErrorHandler { } } - // Uncaught exception handler + /** + * Uncaught exception handler + * + * @param \Exception $exception + */ public static function onException($exception) { - $msg = $exception->getMessage() . ' at ' . $exception->getFile() . '#' . $exception->getLine(); - self::$logger->critical(self::removePassword($msg), array('app' => 'PHP')); + $class = get_class($exception); + $msg = $exception->getMessage(); + $msg = "$class: $msg at " . $exception->getFile() . '#' . $exception->getLine(); + self::$logger->critical(self::removePassword($msg), ['app' => 'PHP']); } //Recoverable errors handler