Catch any exceptions here continue
authorMichael J. Rubinsky <mrubinsk@horde.org>
Sun, 7 Jun 2009 19:02:29 +0000 (15:02 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Sun, 7 Jun 2009 19:03:16 +0000 (15:03 -0400)
timeobjects/lib/Driver/Weatherdotcom.php
timeobjects/lib/api.php

index cf4790d..4937857 100644 (file)
@@ -27,6 +27,8 @@ class TimeObjects_Driver_Weatherdotcom extends TimeObjects_Driver
             $params['location'] = $contact['homeCity'] . (!empty($contact['homeProvince']) ? ', ' . $contact['homeProvince'] : '') . (!empty($contact['homeCountry']) ? ', ' . $contact['homeCountry'] : '');
         }
 
+        // TODO: Try some other way?
+
         parent::__construct($params);
     }
 
index f79f310..c335ee6 100644 (file)
@@ -46,7 +46,13 @@ function _timeobjects_listTimeObjects($time_categories, $start, $end)
     $return = array();
     foreach ($time_categories as $category) {
         $drv = TimeObjects_Driver::factory($category);
-        $new = $drv->listTimeObjects($start, $end);
+
+        try {
+            $new = $drv->listTimeObjects($start, $end);
+        } catch (TimeObjects_Exception $e) {
+            //@TODO: Log the error,  but return an empty array.
+            $new = array();
+        }
         $return = array_merge($return, $new);
     }