diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-05-19 12:35:22 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-05-19 12:35:22 +0200 |
commit | ad88a7d53d039207eddc82993920beab26375f62 (patch) | |
tree | 37d5d8743947d5d6981e715f760c69d5e0240b1d | |
parent | 5899b7b6ea1f8573370168333c16df38d80a5a38 (diff) | |
download | nextcloud-server-ad88a7d53d039207eddc82993920beab26375f62.tar.gz nextcloud-server-ad88a7d53d039207eddc82993920beab26375f62.zip |
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",
-rw-r--r-- | lib/private/log/errorhandler.php | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/private/log/errorhandler.php b/lib/private/log/errorhandler.php index b1b15f12ed7..5e92db398f9 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 |