mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-27 07:34:35 +02:00
vmware vcsa: better error handling
This commit is contained in:
parent
92182157fc
commit
ae17604eb3
@ -220,6 +220,10 @@ sub request_api {
|
||||
$self->{output}->add_option_msg(short_msg => "Error while retrieving data (add --debug option for detailed message)");
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
if ($self->{http}->get_code() != 200) {
|
||||
$self->{output}->add_option_msg(short_msg => 'api request error: ' . (defined($decoded->{type}) ? $decoded->{type} : 'unknown'));
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
|
||||
return $decoded;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user