try/catch when calling facebook methods - the rethrow as our own exception
authorMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 8 Jun 2009 18:13:02 +0000 (14:13 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 8 Jun 2009 18:13:02 +0000 (14:13 -0400)
timeobjects/lib/Driver/FacebookEvents.php

index 911da1d..790e1fb 100644 (file)
@@ -34,8 +34,12 @@ class TimeObjects_Driver_FacebookEvents
      */
     public function listTimeObjects($start = null, $time = null)
     {
-        $fb = $this->_getFacebook();
-        $events = $fb->events->get();
+        try {
+            $fb = $this->_getFacebook();
+            $events = $fb->events->get();
+        } catch (Horde_Service_Facebook_Exception $e) {
+            throw new TimeObjects($e->getMessage());
+        }
         $objects = array();
         foreach ($events as $event) {
             // FB s*cks. This may be right, or it may be wrong, or they may