diff --git a/apps/files/lib/Service/OwnershipTransferService.php b/apps/files/lib/Service/OwnershipTransferService.php
index 8c4c078758e43..cc54df5054197 100644
--- a/apps/files/lib/Service/OwnershipTransferService.php
+++ b/apps/files/lib/Service/OwnershipTransferService.php
@@ -349,7 +349,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();
}