Browse Source

se agregaron exceptions

Guillermo Espinoza 8 years ago
parent
commit
f81213b3da
1 changed files with 11 additions and 2 deletions
  1. 11 2
      Services/Webservice.php

+ 11 - 2
Services/Webservice.php

@@ -43,7 +43,11 @@ class Webservice
             foreach ($params as $param => $value) {
                 $url .= "&filters[{$param}]=$value";
             }
-            $objectsJson = json_decode(file_get_contents($url), true);
+            try {
+                $objectsJson = json_decode(file_get_contents($url), true);
+            } catch (\Exception $ex) {
+                
+            }
         }
         
         return $objectsJson;
@@ -79,7 +83,12 @@ class Webservice
                 $url .= "&offset={$offset}";
             }
 
-            $data = json_decode(file_get_contents($url), true);
+            $data = array();
+            try {
+                $data = json_decode(file_get_contents($url), true);
+            } catch (\Exception $ex) {
+
+            }
 
             //$data['url'] = $url;