diff options
author | eleith <online+github@eleith.com> | 2020-09-19 22:47:30 -0700 |
---|---|---|
committer | leith abdulla <online-nextcloud@eleith.com> | 2020-09-29 20:47:38 -0700 |
commit | aa956ab46e66f22876769fac4f53da4f0425192b (patch) | |
tree | b5e4da8f107106258f1f9276d01fde2a54609a65 /apps/dav/lib/CalDAV/WebcalCaching/RefreshWebcalService.php | |
parent | bdc60ef9b2d4793b3da7887632fb4b0e77bf964a (diff) | |
download | nextcloud-server-aa956ab46e66f22876769fac4f53da4f0425192b.tar.gz nextcloud-server-aa956ab46e66f22876769fac4f53da4f0425192b.zip |
broaden exception handling on webcal refresh
when iterating through a calendar, recurrance events can throw an
exception if no instances of the recurrance are found.
this exception is of class `Exception` but the try/catch clause in the
webcal refresh loop only catches `BadRequest` exception.
this leads to the exception bubbling up and thus other calendar events
do not get processed by the event iterator.
this PR broadens the exception to handle both BadRequest and
NoInstanceFoundException so that the full webcal can be processed, even
if minor hiccups are processing on vobject
Signed-off-by: leith abdulla <online-nextcloud@eleith.com>
Diffstat (limited to 'apps/dav/lib/CalDAV/WebcalCaching/RefreshWebcalService.php')
-rw-r--r-- | apps/dav/lib/CalDAV/WebcalCaching/RefreshWebcalService.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/dav/lib/CalDAV/WebcalCaching/RefreshWebcalService.php b/apps/dav/lib/CalDAV/WebcalCaching/RefreshWebcalService.php index b11520015db..6182107a69c 100644 --- a/apps/dav/lib/CalDAV/WebcalCaching/RefreshWebcalService.php +++ b/apps/dav/lib/CalDAV/WebcalCaching/RefreshWebcalService.php @@ -4,6 +4,7 @@ declare(strict_types=1); /** * @copyright Copyright (c) 2020, Thomas Citharel <nextcloud@tcit.fr> + * @copyright Copyright (c) 2020, leith abdulla (<online-nextcloud@eleith.com>) * * @author Christoph Wurst <christoph@winzerhof-wurst.at> * @author Georg Ehrke <oc.list@georgehrke.com> @@ -45,6 +46,7 @@ use Sabre\DAV\Xml\Property\Href; use Sabre\VObject\Component; use Sabre\VObject\DateTimeParser; use Sabre\VObject\InvalidDataException; +use Sabre\VObject\Recur\NoInstancesException; use Sabre\VObject\ParseException; use Sabre\VObject\Reader; use Sabre\VObject\Splitter\ICalendar; @@ -140,7 +142,7 @@ class RefreshWebcalService { $calendarData = $vObject->serialize(); try { $this->calDavBackend->createCalendarObject($subscription['id'], $uri, $calendarData, CalDavBackend::CALENDAR_TYPE_SUBSCRIPTION); - } catch (BadRequest $ex) { + } catch (NoInstancesException | BadRequest $ex) { $this->logger->logException($ex); } } |