diff options
author | Robin Appelman <robin@icewind.nl> | 2021-02-01 14:56:56 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2021-03-18 08:45:17 +0100 |
commit | 9e3775618bde7c0bf57fa7248e9a7dc2dbb47f4d (patch) | |
tree | 4749233c246458fd57b0b33c2447265a11263a3f /lib/private/Repair.php | |
parent | 9135a42781f52e9853cd5a8c831cb6cc2fcdd7f5 (diff) | |
download | nextcloud-server-9e3775618bde7c0bf57fa7248e9a7dc2dbb47f4d.tar.gz nextcloud-server-9e3775618bde7c0bf57fa7248e9a7dc2dbb47f4d.zip |
log full expection during repair step
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private/Repair.php')
-rw-r--r-- | lib/private/Repair.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/private/Repair.php b/lib/private/Repair.php index 22a715caf1d..353f6c855bc 100644 --- a/lib/private/Repair.php +++ b/lib/private/Repair.php @@ -76,6 +76,7 @@ use OCP\AppFramework\Utility\ITimeFactory; use OCP\Collaboration\Resources\IManager; use OCP\Migration\IOutput; use OCP\Migration\IRepairStep; +use Psr\Log\LoggerInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\EventDispatcher\GenericEvent; @@ -90,15 +91,18 @@ class Repair implements IOutput { /** @var string */ private $currentStep; + private $logger; + /** * Creates a new repair step runner * * @param IRepairStep[] $repairSteps array of RepairStep instances * @param EventDispatcherInterface $dispatcher */ - public function __construct(array $repairSteps, EventDispatcherInterface $dispatcher) { + public function __construct(array $repairSteps, EventDispatcherInterface $dispatcher, LoggerInterface $logger) { $this->repairSteps = $repairSteps; $this->dispatcher = $dispatcher; + $this->logger = $logger; } /** @@ -117,6 +121,7 @@ class Repair implements IOutput { try { $step->run($this); } catch (\Exception $e) { + $this->logger->error("Exception while executing repair step " . $step->getName(), ['exception' => $e]); $this->emit('\OC\Repair', 'error', [$e->getMessage()]); } } |