Skip to content

Commit 4ad80ec

Browse files
author
Erik Lenoir
committed
1 parent 44e20b4 commit 4ad80ec

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/main/java/multichain/command/builders/QueryBuilderCommon.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,11 @@ protected StringEntity prepareRpcEntity(Map<String, Object> entityValues) throws
193193

194194
private Object executeRequest() throws IOException, ClientProtocolException, MultichainException {
195195
HttpResponse response = httpclient.execute(httppost);
196+
int statusCode = response.getStatusLine().getStatusCode();
197+
if (statusCode >= 400) {
198+
throw new MultichainException("code :" + statusCode,
199+
"message : " + response.getStatusLine().getReasonPhrase());
200+
}
196201
HttpEntity entity = response.getEntity();
197202

198203
String rpcAnswer = EntityUtils.toString(entity);

0 commit comments

Comments
 (0)