Merge pull request #7818 from owncloud/logException_undefined_variable
Fix 'Undefined variable: message' in OCP\Util::logException
This commit is contained in:
commit
970878b581
|
@ -89,14 +89,11 @@ class Util {
|
||||||
*/
|
*/
|
||||||
public static function logException( $app, \Exception $ex ) {
|
public static function logException( $app, \Exception $ex ) {
|
||||||
$class = get_class($ex);
|
$class = get_class($ex);
|
||||||
if ($class !== 'Exception') {
|
$message = $class . ': ' . $ex->getMessage();
|
||||||
$message = $class . ': ';
|
|
||||||
}
|
|
||||||
$message .= $ex->getMessage();
|
|
||||||
if ($ex->getCode()) {
|
if ($ex->getCode()) {
|
||||||
$message .= ' [' . $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) {
|
if (defined('DEBUG') and DEBUG) {
|
||||||
// also log stack trace
|
// also log stack trace
|
||||||
$stack = explode("\n", $ex->getTraceAsString());
|
$stack = explode("\n", $ex->getTraceAsString());
|
||||||
|
|
Loading…
Reference in New Issue