소스 검색

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;