diff --git a/src/main/java/monero/common/MoneroRpcConnection.java b/src/main/java/monero/common/MoneroRpcConnection.java index d84620ca..bd4808ae 100644 --- a/src/main/java/monero/common/MoneroRpcConnection.java +++ b/src/main/java/monero/common/MoneroRpcConnection.java @@ -609,12 +609,13 @@ private static void validateHttpResponse(CloseableHttpResponse resp) { } @SuppressWarnings("unchecked") - private static void validateRpcResponse(Map respMap, String method, Object params) { + private void validateRpcResponse(Map respMap, String method, Object params) { Map error = (Map) respMap.get("error"); if (error == null) return; - String msg = (String) error.get("message"); + String errorMsg = (String) error.get("message"); int code = ((BigInteger) error.get("code")).intValue(); - throw new MoneroRpcError(msg, code, method, params); + if ("".equals(errorMsg)) errorMsg = "Received error response from RPC request with method '" + method + "' to " + uri; // TODO (monero-project): response sometimes has empty error message + throw new MoneroRpcError(errorMsg, code, method, params); } private RequestConfig getRequestConfig(Long timeoutInMs) {