diff options
author | Thomas Müller <DeepDiver1975@users.noreply.github.com> | 2016-04-20 22:41:02 +0200 |
---|---|---|
committer | Thomas Müller <DeepDiver1975@users.noreply.github.com> | 2016-04-20 22:41:02 +0200 |
commit | a061ef75ead3d5eb9fa5e713301b7452b3b12b73 (patch) | |
tree | ea758fc9cbf054e513e4358b63fc3b3a3a6d30b0 /lib | |
parent | 7e2a1656f9e9fbfda7835bf448a7c63100ab2378 (diff) | |
parent | 7fea9974b7b3d0177678c5b577e10c930c13eb1e (diff) | |
download | nextcloud-server-a061ef75ead3d5eb9fa5e713301b7452b3b12b73.tar.gz nextcloud-server-a061ef75ead3d5eb9fa5e713301b7452b3b12b73.zip |
Merge pull request #24127 from owncloud/handle-app-loading-error
Handle app loading error
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/app.php | 12 | ||||
-rw-r--r-- | lib/private/log.php | 4 | ||||
-rw-r--r-- | lib/private/template.php | 2 | ||||
-rw-r--r-- | lib/public/ilogger.php | 4 |
4 files changed, 15 insertions, 7 deletions
diff --git a/lib/private/app.php b/lib/private/app.php index 05d220f7d38..8a8b97d2cd4 100644 --- a/lib/private/app.php +++ b/lib/private/app.php @@ -159,8 +159,16 @@ class OC_App { * @param string $app app name */ private static function requireAppFile($app) { - // encapsulated here to avoid variable scope conflicts - require_once $app . '/appinfo/app.php'; + try { + // encapsulated here to avoid variable scope conflicts + require_once $app . '/appinfo/app.php'; + } catch (Error $ex) { + \OC::$server->getLogger()->logException($ex); + $blacklist = \OC::$server->getAppManager()->getAlwaysEnabledApps(); + if (!in_array($app, $blacklist)) { + self::disable($app); + } + } } /** diff --git a/lib/private/log.php b/lib/private/log.php index 9a2a2da906e..bbdad9cf166 100644 --- a/lib/private/log.php +++ b/lib/private/log.php @@ -270,12 +270,12 @@ class Log implements ILogger { /** * Logs an exception very detailed * - * @param \Exception $exception + * @param \Exception | \Throwable $exception * @param array $context * @return void * @since 8.2.0 */ - public function logException(\Exception $exception, array $context = array()) { + public function logException($exception, array $context = array()) { $exception = array( 'Exception' => get_class($exception), 'Message' => $exception->getMessage(), diff --git a/lib/private/template.php b/lib/private/template.php index c6542356fac..73725529702 100644 --- a/lib/private/template.php +++ b/lib/private/template.php @@ -333,7 +333,7 @@ class OC_Template extends \OC\Template\Base { /** * print error page using Exception details - * @param Exception $exception + * @param Exception | Throwable $exception */ public static function printExceptionErrorPage($exception, $fetchPage = false) { try { diff --git a/lib/public/ilogger.php b/lib/public/ilogger.php index 6a4163875a9..fa947612fcd 100644 --- a/lib/public/ilogger.php +++ b/lib/public/ilogger.php @@ -135,10 +135,10 @@ interface ILogger { * ]); * </code> * - * @param \Exception $exception + * @param \Exception | \Throwable $exception * @param array $context * @return void * @since 8.2.0 */ - public function logException(\Exception $exception, array $context = array()); + public function logException($exception, array $context = array()); } |