From 73e9d71e082279f104655816b2813ac637109aba Mon Sep 17 00:00:00 2001 From: anysoft Date: Fri, 15 Nov 2019 17:18:25 +0800 Subject: [PATCH] response error node except int 0 some server response has error node. when success the error node is int value 0; --- src/main/java/com/googlecode/jsonrpc4j/JsonRpcClient.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/googlecode/jsonrpc4j/JsonRpcClient.java b/src/main/java/com/googlecode/jsonrpc4j/JsonRpcClient.java index a99f76e..73cac55 100644 --- a/src/main/java/com/googlecode/jsonrpc4j/JsonRpcClient.java +++ b/src/main/java/com/googlecode/jsonrpc4j/JsonRpcClient.java @@ -325,7 +325,7 @@ private boolean isIdValueNotCorrect(String id, ObjectNode jsonObject) { } protected boolean hasError(ObjectNode jsonObject) { - return jsonObject.has(ERROR) && jsonObject.get(ERROR) != null && !jsonObject.get(ERROR).isNull(); + return jsonObject.has(ERROR) && jsonObject.get(ERROR) != null && !jsonObject.get(ERROR).isNull() && !(jsonObject.get(ERROR).isInt() && jsonObject.intValue()==0) ; } /**