浏览代码

se agregaron exceptions

Guillermo Espinoza 8 年之前
父节点
当前提交
f81213b3da
共有 1 个文件被更改,包括 11 次插入2 次删除
  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;