+ elsif ($client->responseCode() eq '404') {
+ eval { $result = decode_json($client->responseContent()) };
+ unless ($result) {
+ $self->{'__saisei_error'} = "There was an error decoding the JSON data from Saisei. Bad JSON data logged in error log if debug option was set.";
+ warn "Saisei RC 404 Response Content is not json\n".$client->responseContent()."\n" if $self->option('debug');
+ return;
+ }
+ ## check if message is for empty hash.
+ my($does_not_exist) = $result->{message} =~ /'(.*)' does not exist$/;
+ $self->{'__saisei_error'} = "Saisei Error: ".$result->{message} unless $does_not_exist;
+ warn "Saisei Response Content is\n".$client->responseContent."\n" if ($self->option('debug') && !$does_not_exist);
+ return;
+ }
+ elsif ($client->responseCode() eq '500') {
+ $self->{'__saisei_error'} = "Could not connect to the host (".$self->{Hash}->{machine}.':'.$self->option('port').") during $method , we received the responce code: " . $client->responseCode();
+ warn "Saisei Response Content is\n".$client->responseContent."\n" if $self->option('debug');
+ return;
+ }