Scripted decision node API call - Connection closed

We are getting Connection closed for httpClient.send sometime , is there way to find out the issue why its failing with Connection closed. We are using AM so calling IDM API which sometime giving connection closed on AM script log. but when we are checking IDM log its 200 success.
java.util.concurrent.ExecutionException: java.lang.RuntimeException: org.apache.http.ConnectionClosedException: Connection closed

Any help on this please .