Skip to content

Commit

Permalink
log exception type for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
IljaN committed Apr 29, 2024
1 parent c74810d commit 0ee0e05
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions apps/files/lib/Command/TransferOwnership.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ private function collectUsersShares(InputInterface $input, OutputInterface $outp
}
} catch (NotFoundException | NoUserException $e) {
$skipped++;
\OC::$server->getLogger()->logException($e);
$output->writeln("<error>Share with id {$share->getId()} and type {$share->getShareType()} points at deleted file or share that is no longer accessible, skipping</error>");
$progress->advance(1);
}
Expand All @@ -359,6 +360,7 @@ private function collectUsersShares(InputInterface $input, OutputInterface $outp
try {
$share->getNode()->getId(); // force loading the fileinfo
} catch (NotFoundException | NoUserException $e) {
\OC::$server->getLogger()->logException($e);
$output->writeln("<error>Share with id {$share->getId()} and type {$share->getShareType()} points at deleted file or share that is no longer accessible, skipping</error>");
return false;
}
Expand Down Expand Up @@ -442,6 +444,7 @@ private function restoreShares(OutputInterface $output) {
}
$this->shareManager->transferShare($share, $this->sourceUser, $this->destinationUser, $this->finalTarget);
} catch (NotFoundException | NoUserException $e) {
\OC::$server->getLogger()->logException($e);
$output->writeln("error>Share with id {$share->getId()} and type {$share->getShareType()} points at deleted file or share that is no longer accessible, skipping</error>");
} catch (\Exception $e) {
$output->writeln('<error>Could not restore share with id ' . $share->getId() . ':' . $e->getTraceAsString() . '</error>');
Expand Down

0 comments on commit 0ee0e05

Please sign in to comment.