- Timestamp:
- Aug 30, 2015, 8:56:51 PM (11 years ago)
- Branches:
- master
- Children:
- 7e8f16c
- Parents:
- 552da81
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/webservice/htdocs/SiWeather/Webservice/IpGeoLocator.php
r552da81 rb757e0e 46 46 [ 47 47 "base_uri" => $baseUrl, 48 "timeout" => 5.0,48 "timeout" => 1.0, # we need a very small timeout here, because otherwise the request of our caller function may time out! 49 49 "http_errors" => false, 50 50 ] 51 51 ); 52 $response = $client->get("/json/". $ip); 52 try{ 53 $response = $client->get("/json/". $ip); 54 } 55 catch(\GuzzleHttp\Exception\ConnectException $exception){ 56 $errorMessage = "IpGeoLocator: Fetched connect exception (mostly timeout): ". $exception->getMessage(); 57 error_log($errorMessage); 58 return null; 59 } 53 60 if(is_null($response)){ 54 61 $errorMessage = "IpGeoLocator: Failed to fetch ip"; 62 error_log($errorMessage); 55 63 return null; 56 64 }
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/siweather/chrome/site/your_project_logo.png)