Fix 'Undefined variable: message' in OCP\Util::logException

This commit is contained in:
Thomas Tanghus 2014-03-20 10:23:40 +01:00
parent 3aa8647634
commit 51fe3b8ccd
1 changed files with 2 additions and 5 deletions

View File

@ -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());