Skip to content

Commit

Permalink
Catch Horde_Date_Exception.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed Nov 27, 2013
1 parent 21ba37b commit 3c1946f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions kronolith/lib/Event/Horde.php
Expand Up @@ -97,7 +97,7 @@ public function __construct($driver, $eventObject = null)
/**
* Imports a backend specific event object.
*
* @param array $event Backend specific event object that this object
* @param mixed $event Backend specific event object that this object
* will represent.
*/
public function fromDriver($event)
Expand All @@ -109,8 +109,12 @@ public function fromDriver($event)
if (isset($event['location'])) {
$this->location = $event['location'];
}
$this->start = new Horde_Date($event['start']);
$this->end = new Horde_Date($event['end']);
try {
$this->start = new Horde_Date($event['start']);
$this->end = new Horde_Date($event['end']);
} catch (Horde_Date_Exception $e) {
throw new Kronolith_Exception($e);
}
if (isset($event['status'])) {
switch ($event['status']) {
case 'confirmed':
Expand Down

0 comments on commit 3c1946f

Please sign in to comment.