diff --git a/src/main/java/com/googlecode/jsonrpc4j/JsonRpcBasicServer.java b/src/main/java/com/googlecode/jsonrpc4j/JsonRpcBasicServer.java index 9e195ff..936b5c9 100644 --- a/src/main/java/com/googlecode/jsonrpc4j/JsonRpcBasicServer.java +++ b/src/main/java/com/googlecode/jsonrpc4j/JsonRpcBasicServer.java @@ -252,7 +252,8 @@ public int handleRequest(final InputStream input, final OutputStream output) thr } return jsonResponse.getCode(); } catch (JsonParseException | JsonMappingException e) { - JsonResponse responseError = createResponseError(VERSION, NULL, JsonError.PARSE_ERROR); + JsonError jsonError = new JsonError(JsonError.METHOD_PARAMS_INVALID.code, e.getMessage(), null); + JsonResponse responseError = createResponseError(VERSION, NULL, jsonError); writeAndFlushValue(output, responseError.getResponse()); return responseError.getCode(); } @@ -474,7 +475,7 @@ private JsonResponse handleObject(final ObjectNode node) } private JsonResponse handleParameterConvertError(ParameterConvertException pce, Object id, String jsonRpc) { - String errorMsg = "Failed to read method parameter at index " + pce.paramIndex; + String errorMsg = "Failed to read method parameter at index " + pce.paramIndex + ", " + pce.getCause().getMessage(); JsonError jsonError = new JsonError( JsonError.METHOD_PARAMS_INVALID.code, errorMsg,