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",

This commit is contained in:
Thomas Müller 2015-05-19 12:35:22 +02:00
parent 5899b7b6ea
commit ad88a7d53d
1 changed files with 9 additions and 3 deletions

View File

@ -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