diff --git a/apps/files/lib/Service/OwnershipTransferService.php b/apps/files/lib/Service/OwnershipTransferService.php
index 66b3550b0773d..041e6ca0505e3 100644
--- a/apps/files/lib/Service/OwnershipTransferService.php
+++ b/apps/files/lib/Service/OwnershipTransferService.php
@@ -351,7 +351,7 @@ private function restoreShares(string $sourceUid,
} catch (\OCP\Files\NotFoundException $e) {
$output->writeln('Share with id ' . $share->getId() . ' points at deleted file, skipping');
} catch (\Throwable $e) {
- $output->writeln('Could not restore share with id ' . $share->getId() . ':' . $e->getTraceAsString() . '');
+ $output->writeln('Could not restore share with id ' . $share->getId() . ':' . $e->getMessage() . ' : ' . $e->getTraceAsString() . '');
}
$progress->advance();
}