From 055ae9b2cd9f37f854d3c8c4f7e2051cd116fa53 Mon Sep 17 00:00:00 2001 From: Tobia De Koninck Date: Fri, 3 Jan 2020 08:50:37 +0100 Subject: 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 --- apps/files/lib/Service/OwnershipTransferService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/files/lib/Service/OwnershipTransferService.php b/apps/files/lib/Service/OwnershipTransferService.php index 3dc55615c95..b130910e25b 100644 --- a/apps/files/lib/Service/OwnershipTransferService.php +++ b/apps/files/lib/Service/OwnershipTransferService.php @@ -286,7 +286,7 @@ class OwnershipTransferService { } } catch (\OCP\Files\NotFoundException $e) { $output->writeln('Share with id ' . $share->getId() . ' points at deleted file, skipping'); - } catch (\Exception $e) { + } catch (\Throwable $e) { $output->writeln('Could not restore share with id ' . $share->getId() . ':' . $e->getTraceAsString() . ''); } $progress->advance(); -- cgit v1.2.3