]> source.dussan.org Git - nextcloud-server.git/commitdiff
Catch \Error in Transfer::restoreShares
authorTobia De Koninck <LEDfan@users.noreply.github.com>
Fri, 3 Jan 2020 07:50:37 +0000 (08:50 +0100)
committerRoeland Jago Douma <roeland@famdouma.nl>
Mon, 3 Feb 2020 10:15:56 +0000 (11:15 +0100)
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>
apps/files/lib/Service/OwnershipTransferService.php

index 3dc55615c9525c9a4f42da2d8b0807f1d1302ae7..b130910e25b31ad6d24c760ecabef46f52fcb037 100644 (file)
@@ -286,7 +286,7 @@ class OwnershipTransferService {
                                }
                        } catch (\OCP\Files\NotFoundException $e) {
                                $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>');
                        }
                        $progress->advance();