Skip to content

Commit

Permalink
use loggerinterface
Browse files Browse the repository at this point in the history
Signed-off-by: Maxence Lange <[email protected]>
  • Loading branch information
ArtificialOwl committed Jan 26, 2023
1 parent 9e1914c commit 819cecf
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions apps/files_sharing/lib/Controller/ShareAPIController.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@
use OCP\Share\IManager;
use OCP\Share\IShare;
use OCP\UserStatus\IManager as IUserStatusManager;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
use Psr\Log\LoggerInterface;

/**
* Class Share20OCS
Expand Down Expand Up @@ -410,8 +413,7 @@ private function fixMissingDisplayName(array $shares, ?array $updatedDisplayName
* @param bool $cacheOnly - do not reach LUS, get data from cache.
*
* @return array
* @psalm-suppress DeprecatedMethod
* @psalm-suppress UndefinedClass
* @throws ContainerExceptionInterface
*/
private function retrieveFederatedDisplayName(array $userIds, bool $cacheOnly = false): array {
// check if gss is enabled and available
Expand All @@ -422,9 +424,15 @@ private function retrieveFederatedDisplayName(array $userIds, bool $cacheOnly =
}

try {
/**
* @psalm-suppress UndefinedClass
*/
$slaveService = Server::get(\OCA\GlobalSiteSelector\Service\SlaveService::class);
} catch (Exception $e) {
\OC::$server->getLogger()->logException($e);
} catch (\Throwable $e) {
Server::get(LoggerInterface::class)->error(
$e->getMessage(),
['exception' => $e]
);
return [];
}

Expand Down

0 comments on commit 819cecf

Please sign in to comment.