Skip to content
Snippets Groups Projects
Commit 970878b5 authored by Morris Jobke's avatar Morris Jobke
Browse files

Merge pull request #7818 from owncloud/logException_undefined_variable

Fix 'Undefined variable: message' in OCP\Util::logException
parents 8a81df0f 51fe3b8c
No related branches found
No related tags found
No related merge requests found
......@@ -89,14 +89,11 @@ class Util {
*/
public static function logException( $app, \Exception $ex ) {
$class = get_class($ex);
if ($class !== 'Exception') {
$message = $class . ': ';
}
$message .= $ex->getMessage();
$message = $class . ': ' . $ex->getMessage();
if ($ex->getCode()) {
$message .= ' [' . $ex->getCode() . ']';
}
\OCP\Util::writeLog($app, 'Exception: ' . $message, \OCP\Util::FATAL);
\OCP\Util::writeLog($app, $message, \OCP\Util::FATAL);
if (defined('DEBUG') and DEBUG) {
// also log stack trace
$stack = explode("\n", $ex->getTraceAsString());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment