@Override
    public <T> void execute(URI uri, String httpMethod, RequestHttpEntity requestHttpEntity,
            final ResponseHandler<T> responseHandler, final Callback<T> callback) throws Exception {
        HttpRequestBase httpRequestBase = DefaultHttpClientRequest.build(uri, httpMethod, requestHttpEntity, defaultConfig);
        try {
            asyncClient.execute(httpRequestBase, new FutureCallback<HttpResponse>() {
                @Override
                public void completed(HttpResponse result) {
                    DefaultClientHttpResponse response = new DefaultClientHttpResponse(result);
                    try {
                        HttpRestResult<T> httpRestResult = responseHandler.handle(response);
                        callback.onReceive(httpRestResult);
                    } catch (Exception e) {
                        callback.onError(e);
                    } finally {
                        HttpClientUtils.closeQuietly(result);
                    }
                }
                
                @Override
                public void failed(Exception ex) {
                    callback.onError(ex);
                }
                
                @Override
                public void cancelled() {
                    callback.onCancel();
                }
            });
        } catch (IllegalStateException e) {
            final List<ExceptionEvent> events = ioreactor.getAuditLog();
            if (events != null) {
                for (ExceptionEvent event : events) {
                    if (event != null) {
                        LOGGER.error("[DefaultAsyncHttpClientRequest] IllegalStateException! I/O Reactor error time: {}",
                                event.getTimestamp(), event.getCause());
                    }
                }
            }
            throw e;
        }
        
    }
@Test
    void testExecuteOnCompleteWithException() throws Exception {
        Header header = Header.newInstance();
        Map<String, String> body = new HashMap<>();
        body.put("test", "test");
        RequestHttpEntity httpEntity = new RequestHttpEntity(header, Query.EMPTY, body);
        HttpResponse response = mock(HttpResponse.class);
        RuntimeException exception = new RuntimeException("test");
        when(responseHandler.handle(any())).thenThrow(exception);
        when(client.execute(any(), any())).thenAnswer(invocationOnMock -> {
            ((FutureCallback) invocationOnMock.getArgument(1)).completed(response);
            return null;
        });
        httpClientRequest.execute(uri, "PUT", httpEntity, responseHandler, callback);
        verify(callback).onError(exception);
    }