Catch \Error in Transfer::restoreShares

This makes the command more fault tolerant. An \Error can happen when
e.g. the owner of a share is null.
If we don't catch this, the restore process will stop in an unknown
state.

Signed-off-by: Tobia De Koninck <LEDfan@users.noreply.github.com>
This commit is contained in:
Tobia De Koninck 2020-01-03 08:50:37 +01:00 committed by Roeland Jago Douma
parent 97508f69ec
commit 055ae9b2cd
No known key found for this signature in database
GPG Key ID: F941078878347C0C
1 changed files with 1 additions and 1 deletions

View File

@ -286,7 +286,7 @@ class OwnershipTransferService {
} }
} catch (\OCP\Files\NotFoundException $e) { } catch (\OCP\Files\NotFoundException $e) {
$output->writeln('<error>Share with id ' . $share->getId() . ' points at deleted file, skipping</error>'); $output->writeln('<error>Share with id ' . $share->getId() . ' points at deleted file, skipping</error>');
} catch (\Exception $e) { } catch (\Throwable $e) {
$output->writeln('<error>Could not restore share with id ' . $share->getId() . ':' . $e->getTraceAsString() . '</error>'); $output->writeln('<error>Could not restore share with id ' . $share->getId() . ':' . $e->getTraceAsString() . '</error>');
} }
$progress->advance(); $progress->advance();