expand error handling, fix typo in commandref

This commit is contained in:
Marko Oldenburg 2019-01-13 09:22:28 +01:00
parent 133f17427f
commit 1dde02d570
3 changed files with 476 additions and 470 deletions

View File

@ -811,7 +811,7 @@ sub WeatherAsHtmlD($;$)
Beispiele:
<pre>
define Forecast Weather apikey=987498ghjgf864
define MyWeather Weather api=OpenWeatherMapAPI,cachemaxage:600 apikey=09878945fdskv876 location=52.4545,13.4545 interval=3600 language=de
define MyWeather Weather API=OpenWeatherMapAPI,cachemaxage:600 apikey=09878945fdskv876 location=52.4545,13.4545 interval=3600 language=de
</pre>
Es folgt die API-spezifische Dokumentation.<p>

View File

@ -189,6 +189,7 @@ sub _ProcessingRetrieveData($$) {
and defined($response)
and $response )
{
if ( $response =~ m/^{.*}$/ ) {
my $data = eval { decode_json($response) };
if ($@) {
@ -483,6 +484,8 @@ sub _ProcessingRetrieveData($$) {
}
}
}
else { _ErrorHandling( $self, 'DarkSky Weather ' . $response ); }
}
## Aufruf der callbackFn
_CallWeatherCallbackFn($self);

View File

@ -243,6 +243,7 @@ sub _ProcessingRetrieveData($$) {
and defined($response)
and $response )
{
if ( $response =~ m/^{.*}$/ ) {
my $data = eval { decode_json($response) };
if ($@) {
@ -438,6 +439,8 @@ sub _ProcessingRetrieveData($$) {
}
}
}
else { _ErrorHandling( $self, 'OpenWeatherMap ' . $response ); }
}
$self->{endpoint} = 'none' if ( $self->{endpoint} eq 'forecast' );