doy/json-rpc-common — pull request #2 by ioanrogers (2012-03-20 03:05:10+00:00)
Title: Catch JSON blowing up if returned data isn't json. 

Using via JSON::RPC::LWP, if there is a connection problem, LWP returns this:

> LWP::Protocol::http::Socket: connect: Connection refused

Leading to sudden death from this:

> malformed JSON string, neither array, object, number, string or atom, at character offset 0 (before "Can't connect to 127...") at /home/ioan/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/x86_64-linux-thread-multi/Moose/Meta/Method/Delegation.pm line 110.