|
|
|
|
@ -43,10 +43,10 @@ use OCP\Dashboard\IWidget; |
|
|
|
|
use OCP\EventDispatcher\IEventDispatcher; |
|
|
|
|
use OCP\Files\Template\ICustomTemplateProvider; |
|
|
|
|
use OCP\Http\WellKnown\IHandler; |
|
|
|
|
use OCP\ILogger; |
|
|
|
|
use OCP\Notification\INotifier; |
|
|
|
|
use OCP\Search\IProvider; |
|
|
|
|
use OCP\Support\CrashReport\IReporter; |
|
|
|
|
use Psr\Log\LoggerInterface; |
|
|
|
|
use Throwable; |
|
|
|
|
use function array_shift; |
|
|
|
|
|
|
|
|
|
@ -97,10 +97,10 @@ class RegistrationContext { |
|
|
|
|
/** @var ServiceRegistration<\OCP\Authentication\TwoFactorAuth\IProvider>[] */ |
|
|
|
|
private $twoFactorProviders = []; |
|
|
|
|
|
|
|
|
|
/** @var ILogger */ |
|
|
|
|
/** @var LoggerInterface */ |
|
|
|
|
private $logger; |
|
|
|
|
|
|
|
|
|
public function __construct(ILogger $logger) { |
|
|
|
|
public function __construct(LoggerInterface $logger) { |
|
|
|
|
$this->logger = $logger; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -313,9 +313,8 @@ class RegistrationContext { |
|
|
|
|
->registerCapability($registration->getService()); |
|
|
|
|
} catch (Throwable $e) { |
|
|
|
|
$appId = $registration->getAppId(); |
|
|
|
|
$this->logger->logException($e, [ |
|
|
|
|
'message' => "Error during capability registration of $appId: " . $e->getMessage(), |
|
|
|
|
'level' => ILogger::ERROR, |
|
|
|
|
$this->logger->error("Error during capability registration of $appId: " . $e->getMessage(), [ |
|
|
|
|
'exception' => $e, |
|
|
|
|
]); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -330,9 +329,8 @@ class RegistrationContext { |
|
|
|
|
$registry->registerLazy($registration->getService()); |
|
|
|
|
} catch (Throwable $e) { |
|
|
|
|
$appId = $registration->getAppId(); |
|
|
|
|
$this->logger->logException($e, [ |
|
|
|
|
'message' => "Error during crash reporter registration of $appId: " . $e->getMessage(), |
|
|
|
|
'level' => ILogger::ERROR, |
|
|
|
|
$this->logger->error("Error during crash reporter registration of $appId: " . $e->getMessage(), [ |
|
|
|
|
'exception' => $e, |
|
|
|
|
]); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -347,9 +345,8 @@ class RegistrationContext { |
|
|
|
|
$dashboardManager->lazyRegisterWidget($panel->getService()); |
|
|
|
|
} catch (Throwable $e) { |
|
|
|
|
$appId = $panel->getAppId(); |
|
|
|
|
$this->logger->logException($e, [ |
|
|
|
|
'message' => "Error during dashboard registration of $appId: " . $e->getMessage(), |
|
|
|
|
'level' => ILogger::ERROR, |
|
|
|
|
$this->logger->error("Error during dashboard registration of $appId: " . $e->getMessage(), [ |
|
|
|
|
'exception' => $e, |
|
|
|
|
]); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -365,9 +362,8 @@ class RegistrationContext { |
|
|
|
|
); |
|
|
|
|
} catch (Throwable $e) { |
|
|
|
|
$appId = $registration->getAppId(); |
|
|
|
|
$this->logger->logException($e, [ |
|
|
|
|
'message' => "Error during event listener registration of $appId: " . $e->getMessage(), |
|
|
|
|
'level' => ILogger::ERROR, |
|
|
|
|
$this->logger->error("Error during event listener registration of $appId: " . $e->getMessage(), [ |
|
|
|
|
'exception' => $e, |
|
|
|
|
]); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -391,9 +387,8 @@ class RegistrationContext { |
|
|
|
|
); |
|
|
|
|
} catch (Throwable $e) { |
|
|
|
|
$appId = $registration->getAppId(); |
|
|
|
|
$this->logger->logException($e, [ |
|
|
|
|
'message' => "Error during service registration of $appId: " . $e->getMessage(), |
|
|
|
|
'level' => ILogger::ERROR, |
|
|
|
|
$this->logger->error("Error during service registration of $appId: " . $e->getMessage(), [ |
|
|
|
|
'exception' => $e, |
|
|
|
|
]); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -408,9 +403,8 @@ class RegistrationContext { |
|
|
|
|
); |
|
|
|
|
} catch (Throwable $e) { |
|
|
|
|
$appId = $registration->getAppId(); |
|
|
|
|
$this->logger->logException($e, [ |
|
|
|
|
'message' => "Error during service alias registration of $appId: " . $e->getMessage(), |
|
|
|
|
'level' => ILogger::ERROR, |
|
|
|
|
$this->logger->error("Error during service alias registration of $appId: " . $e->getMessage(), [ |
|
|
|
|
'exception' => $e, |
|
|
|
|
]); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -425,9 +419,8 @@ class RegistrationContext { |
|
|
|
|
); |
|
|
|
|
} catch (Throwable $e) { |
|
|
|
|
$appId = $registration->getAppId(); |
|
|
|
|
$this->logger->logException($e, [ |
|
|
|
|
'message' => "Error during service alias registration of $appId: " . $e->getMessage(), |
|
|
|
|
'level' => ILogger::ERROR, |
|
|
|
|
$this->logger->error("Error during service alias registration of $appId: " . $e->getMessage(), [ |
|
|
|
|
'exception' => $e, |
|
|
|
|
]); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -444,9 +437,8 @@ class RegistrationContext { |
|
|
|
|
->registerMiddleWare($middleware->getService()); |
|
|
|
|
} catch (Throwable $e) { |
|
|
|
|
$appId = $middleware->getAppId(); |
|
|
|
|
$this->logger->logException($e, [ |
|
|
|
|
'message' => "Error during capability registration of $appId: " . $e->getMessage(), |
|
|
|
|
'level' => ILogger::ERROR, |
|
|
|
|
$this->logger->error("Error during capability registration of $appId: " . $e->getMessage(), [ |
|
|
|
|
'exception' => $e, |
|
|
|
|
]); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|