2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 10:46:53 +00:00

Included exception handling in 59_Weather.pm to avoid crashes propagated from Weather::Google.pm.

git-svn-id: https://svn.fhem.de/fhem/trunk@483 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
borisneubert 2009-11-22 16:07:31 +00:00
parent 79f7362fe9
commit a8cd428032

View File

@ -84,9 +84,15 @@ sub Weather_GetUpdate($)
# see http://search.cpan.org/~possum/Weather-Google-0.03/lib/Weather/Google.pm
my $location= $hash->{LOCATION};
my $WeatherObj= new Weather::Google($location);
my $WeatherObj;
Log 4, "$name: Updating weather information for $location.";
eval {
$WeatherObj= new Weather::Google($location);
};
if($@) {
Log 1, "$name: Could not retrieve weather information.";
return 0;
}
my $current = $WeatherObj->current_conditions;
foreach my $condition ( keys ( %$current ) ) {