Utils/WikiTagUtils.php
changeset 60 984ba20c150b
parent 50 e967654e90cb
child 63 774ba82dca59
equal deleted inserted replaced
59:ea562f37d7a5 60:984ba20c150b
    58         }
    58         }
    59         else{
    59         else{
    60             return WikiTagUtils::returnNullResult(null);
    60             return WikiTagUtils::returnNullResult(null);
    61         }
    61         }
    62         
    62         
    63         try {
    63         $ar = WikiTagUtils::requestWikipedia($params);
    64             $ar = WikiTagUtils::requestWikipedia($params);
    64 
    65         }
       
    66         catch (\Exception $e){
       
    67             throw new \Exception($e->getMessage());
       
    68         }
       
    69         $res = $ar[0];
    65         $res = $ar[0];
    70         $original_response = $res;
    66         $original_response = $res;
    71         $pages = $ar[1];
    67         $pages = $ar[1];
    72         // If there 0 or more than 1 result, the query has failed
    68         // If there 0 or more than 1 result, the query has failed
    73         if(count($pages)>1 || count($pages)==0){
    69         if(count($pages)>1 || count($pages)==0){