]> source.dussan.org Git - nextcloud-server.git/commitdiff
Show filename in output message 31690/head
authorChristopher Ng <chrng8@gmail.com>
Tue, 29 Mar 2022 23:08:47 +0000 (23:08 +0000)
committerChristopher Ng <chrng8@gmail.com>
Tue, 29 Mar 2022 23:12:52 +0000 (23:12 +0000)
Signed-off-by: Christopher Ng <chrng8@gmail.com>
apps/dav/lib/UserMigration/CalendarMigrator.php

index 8d2f493555f5ce91c7b5229f69c4e70a2aa60ff1..16b213146106f6313cd79a4f1846e6460340cfb0 100644 (file)
@@ -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);
                }
        }