Closed GoogleCodeExporter closed 9 years ago
Felix, thanks for reporting this.
I think both tests should be performed to preserve compatibility with JSONRPC
1.0 (in
which the error field is always present but may have a null value)
So the modification will be along the lines :
// Check for remote errors
if (jsonResponse.has("error")) {
Object jsonError = jsonResponse.get("error");
if (!jsonError.equals(null)) throw new
JSONRPCException(jsonResponse.get("error"));
return jsonResponse; //JSON-RPC 1.0
} else {
return jsonResponse; //JSON-RPC 2.0
}
I'll run some tests and upload svn and package after that.
I have mainly focused on 1.0 spec for the library, so if you encounter other
inconsistent behaviours with 2.0 you are welcome to report them here.
Alexandre
Original comment by alexd6...@gmail.com
on 4 Feb 2010 at 7:21
Original comment by alexd6...@gmail.com
on 4 Feb 2010 at 7:22
Code updated in svn and in the new 0.2.1 release.
Original comment by alexd6...@gmail.com
on 5 Feb 2010 at 5:01
Original issue reported on code.google.com by
felixro...@gmail.com
on 4 Feb 2010 at 12:41