Check the return value of IKC call to spectre
This commit is contained in:
parent
1fa911029d
commit
edcf276a2f
2 changed files with 7 additions and 13 deletions
|
|
@ -54,7 +54,8 @@ sub DESTROY {
|
|||
|
||||
=head2 notify ( module, params )
|
||||
|
||||
Sends a message to Spectre.
|
||||
Sends a message to Spectre. Returns true iff the message was successfully
|
||||
sent.
|
||||
|
||||
=head3 module
|
||||
|
||||
|
|
@ -78,12 +79,10 @@ sub notify {
|
|||
timeout=>10
|
||||
);
|
||||
if (defined $remote) {
|
||||
my $result = $remote->post($module, $params);
|
||||
unless (defined $result) {
|
||||
$error->warn("Couldn't send command to Spectre because ".$POE::Component::IKC::ClientLite::error);
|
||||
my $result = $remote->post($module, $params);
|
||||
return 1 if defined $result;
|
||||
$error->warn("Couldn't send command to Spectre because ".$POE::Component::IKC::ClientLite::error);
|
||||
}
|
||||
$remote->disconnect;
|
||||
undef $remote;
|
||||
} else {
|
||||
$error->warn("Couldn't connect to Spectre because ".$POE::Component::IKC::ClientLite::error);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue