Skip to content

Commit bcf6d91

Browse files
guillemjgregoa
authored andcommitted
JSON::RPC::Legacy::Client: Do not try to parse non-existing JSON
1 parent d34fafe commit bcf6d91

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

lib/JSON/RPC/Legacy/Client.pm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ sub call {
107107

108108
$self->status_line($result->status_line);
109109

110+
# If the server returned an error, we have no JSON.
111+
return if ($result->code >= 500 && $result->code < 600);
112+
110113
return unless($result->content); # notification?
111114

112115
if ($service) {

0 commit comments

Comments
 (0)