From cdb93e7f1d05c95f9c441aa5e84a2089488b22c6 Mon Sep 17 00:00:00 2001 From: Christopher Ng Date: Tue, 29 Mar 2022 23:08:47 +0000 Subject: Show filename in output message Signed-off-by: Christopher Ng --- apps/dav/lib/UserMigration/CalendarMigrator.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'apps/dav') diff --git a/apps/dav/lib/UserMigration/CalendarMigrator.php b/apps/dav/lib/UserMigration/CalendarMigrator.php index 8d2f493555f..16b21314610 100644 --- a/apps/dav/lib/UserMigration/CalendarMigrator.php +++ b/apps/dav/lib/UserMigration/CalendarMigrator.php @@ -321,7 +321,7 @@ class CalendarMigrator implements IMigrator { /** * @throws InvalidCalendarException */ - private function importCalendarObject(int $calendarId, VCalendar $vCalendarObject, OutputInterface $output): void { + private function importCalendarObject(int $calendarId, VCalendar $vCalendarObject, string $filename, OutputInterface $output): void { try { $this->calDavBackend->createCalendarObject( $calendarId, @@ -330,8 +330,7 @@ class CalendarMigrator implements IMigrator { CalDavBackend::CALENDAR_TYPE_CALENDAR, ); } catch (Throwable $e) { - // Rollback creation of calendar on error - $output->writeln('Error creating calendar object, rolling back creation of calendar…'); + $output->writeln("Error creating calendar object, rolling back creation of \"$filename\" calendar…"); $this->calDavBackend->deleteCalendar($calendarId, true); throw new InvalidCalendarException(); } @@ -396,7 +395,7 @@ class CalendarMigrator implements IMigrator { $vCalendarObject->add($component); } } - $this->importCalendarObject($calendarId, $vCalendarObject, $output); + $this->importCalendarObject($calendarId, $vCalendarObject, $filename, $output); } foreach ($ungroupedCalendarComponents as $component) { @@ -405,7 +404,7 @@ class CalendarMigrator implements IMigrator { foreach ($this->getRequiredImportComponents($vCalendar, $component) as $component) { $vCalendarObject->add($component); } - $this->importCalendarObject($calendarId, $vCalendarObject, $output); + $this->importCalendarObject($calendarId, $vCalendarObject, $filename, $output); } } -- cgit v1.2.3