fix typo mistake

This commit is contained in:
Fabien THEPAUT 2020-06-01 17:25:28 -04:00
parent 66f1303595
commit a62364c616
2 changed files with 2 additions and 2 deletions
apps/openweathermap/restapi

View File

@ -146,7 +146,7 @@ sub request_api {
$self->{output}->add_option_msg(short_msg => "Cannot decode json response: $@");
$self->{output}->option_exit();
}
if (!defined($decoded->{code}) || $decoded->{code} != 200) {
if (!defined($decoded->{cod}) || $decoded->{cod} != 200) {
$self->{output}->output_add(long_msg => "Error message : " . $decoded->{errorDetails}, debug => 1);
$self->{output}->add_option_msg(short_msg => "API return error code '" . $decoded->{result} . "' (add --debug option for detailed message)");
$self->{output}->option_exit();

View File

@ -35,7 +35,7 @@ sub new {
);
$self->{custom_modes}{api} = 'apps::openweathermap::restapi::custom::api';
return $self;²
return $self;
}
1;