File tree Expand file tree Collapse file tree 1 file changed +16
-5
lines changed
src/main/java/com/ning/http/client/providers/grizzly Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -250,18 +250,29 @@ public void updated(final Connection c) {
250
250
connectionManager .doAsyncTrackedConnection (request , future , connectHandler );
251
251
} catch (Exception e ) {
252
252
if (e instanceof RuntimeException ) {
253
- throw ( RuntimeException ) e ;
253
+ abort ( future , e ) ;
254
254
} else if (e instanceof IOException ) {
255
- throw (IOException ) e ;
256
- }
257
- if (LOGGER .isWarnEnabled ()) {
258
- LOGGER .warn (e .toString (), e );
255
+ abort (future , e );
256
+ } else {
257
+ if (LOGGER .isWarnEnabled ()) {
258
+ LOGGER .warn (e .toString (), e );
259
+ abort (future , e );
260
+ }
259
261
}
260
262
}
261
263
262
264
return future ;
263
265
}
264
266
267
+ private void abort (GrizzlyResponseFuture <?> future , Throwable t ) {
268
+ if (!future .isDone ()) {
269
+ LOGGER .debug ("Aborting Future {}\n " , future );
270
+ LOGGER .debug (t .getMessage (), t );
271
+ future .abort (t );
272
+ }
273
+ }
274
+
275
+
265
276
@ Override
266
277
public void close () {
267
278
You can’t perform that action at this time.
0 commit comments