Skip to content
Snippets Groups Projects
Unverified Commit 11a27b24 authored by Daniel Kesselberg's avatar Daniel Kesselberg Committed by Morris Jobke
Browse files

Log exception

parent 382495e2
No related branches found
No related tags found
No related merge requests found
...@@ -149,7 +149,7 @@ class Repair implements IOutput { ...@@ -149,7 +149,7 @@ class Repair implements IOutput {
new AddCleanupUpdaterBackupsJob(\OC::$server->getJobList()), new AddCleanupUpdaterBackupsJob(\OC::$server->getJobList()),
new RepairPendingCronJobs(\OC::$server->getDatabaseConnection(), \OC::$server->getConfig()), new RepairPendingCronJobs(\OC::$server->getDatabaseConnection(), \OC::$server->getConfig()),
new SetVcardDatabaseUID(\OC::$server->getDatabaseConnection(), \OC::$server->getConfig(), \OC::$server->getLogger()), new SetVcardDatabaseUID(\OC::$server->getDatabaseConnection(), \OC::$server->getConfig(), \OC::$server->getLogger()),
new CleanupCardDAVPhotoCache(\OC::$server->getConfig(), \OC::$server->getAppDataDir('dav-photocache')), new CleanupCardDAVPhotoCache(\OC::$server->getConfig(), \OC::$server->getAppDataDir('dav-photocache'), \OC::$server->getLogger()),
]; ];
} }
......
...@@ -22,11 +22,11 @@ declare(strict_types=1); ...@@ -22,11 +22,11 @@ declare(strict_types=1);
namespace OC\Repair\NC16; namespace OC\Repair\NC16;
use OC\Files\AppData\AppData;
use OCP\Files\IAppData; use OCP\Files\IAppData;
use OCP\Files\NotFoundException; use OCP\Files\NotFoundException;
use OCP\Files\SimpleFS\ISimpleFolder; use OCP\Files\SimpleFS\ISimpleFolder;
use OCP\IConfig; use OCP\IConfig;
use OCP\ILogger;
use OCP\Migration\IOutput; use OCP\Migration\IOutput;
use OCP\Migration\IRepairStep; use OCP\Migration\IRepairStep;
...@@ -44,12 +44,16 @@ class CleanupCardDAVPhotoCache implements IRepairStep { ...@@ -44,12 +44,16 @@ class CleanupCardDAVPhotoCache implements IRepairStep {
/** @var IConfig */ /** @var IConfig */
private $config; private $config;
/** @var AppData */ /** @var IAppData */
private $appData; private $appData;
public function __construct(IConfig $config, IAppData $appData) { /** @var ILogger */
private $logger;
public function __construct(IConfig $config, IAppData $appData, ILogger $logger) {
$this->config = $config; $this->config = $config;
$this->appData = $appData; $this->appData = $appData;
$this->logger = $logger;
} }
public function getName(): string { public function getName(): string {
...@@ -78,7 +82,8 @@ class CleanupCardDAVPhotoCache implements IRepairStep { ...@@ -78,7 +82,8 @@ class CleanupCardDAVPhotoCache implements IRepairStep {
/** @var ISimpleFolder $folder */ /** @var ISimpleFolder $folder */
$folder->getFile('photo.')->delete(); $folder->getFile('photo.')->delete();
} catch (\Exception $e) { } catch (\Exception $e) {
$output->warning('Could not delete "photo." file in dav-photocache/' . $folder->getName()); $this->logger->logException($e);
$output->warning('Could not delete file "dav-photocache/' . $folder->getName() . '/photo."');
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment