diff --git a/lib/JSON/RPC/Legacy/Client.pm b/lib/JSON/RPC/Legacy/Client.pm index b389c81..404a3f2 100644 --- a/lib/JSON/RPC/Legacy/Client.pm +++ b/lib/JSON/RPC/Legacy/Client.pm @@ -107,6 +107,9 @@ sub call { $self->status_line($result->status_line); + # If the server returned an error, we have no JSON. + return if ($result->code >= 500 && $result->code < 600); + return unless($result->content); # notification? if ($service) {