Skip to content

Commit

Permalink
Catch error when original series is not found for an exception.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Apr 3, 2014
1 parent 3d25bfa commit 023f7eb
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions kronolith/lib/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -1386,6 +1386,7 @@ public function fromiCalendar($vEvent)
* Handle parsing recurrence related fields.
*
* @param Horde_Icalendar $vEvent
* @throws Kronolith_Exception
*/
protected function _handlevEventRecurrence($vEvent)
{
Expand Down Expand Up @@ -1440,11 +1441,15 @@ protected function _handlevEventRecurrence($vEvent)
$this->exceptionoriginaldate = $originaldt;
$this->baseid = $this->uid;
$this->uid = null;
$originalEvent = $kronolith_driver->getByUID($this->baseid);
$originalEvent->recurrence->addException($originaldt->format('Y'),
$originaldt->format('m'),
$originaldt->format('d'));
$originalEvent->save();
try {
$originalEvent = $kronolith_driver->getByUID($this->baseid);
$originalEvent->recurrence->addException($originaldt->format('Y'),
$originaldt->format('m'),
$originaldt->format('d'));
$originalEvent->save();
} catch (Horde_Exception_NotFound $e) {
throw new Kronolith_Exception('Unable to locate original event series.');
}
} catch (Horde_Icalendar_Exception $e) {}
}

Expand Down

0 comments on commit 023f7eb

Please sign in to comment.