@@ -241,15 +241,17 @@ public V get(long l, TimeUnit tu) throws InterruptedException, TimeoutException,
241
241
} catch (Throwable t ) {
242
242
// Ignore
243
243
}
244
- TimeoutException te = new TimeoutException (String .format ("No response received after %s" , l ));
245
244
if (!throwableCalled .getAndSet (true )) {
246
245
try {
247
- asyncHandler .onThrowable (te );
248
- } catch (Throwable t ) {
249
- logger .debug ("asyncHandler.onThrowable" , t );
246
+ TimeoutException te = new TimeoutException (String .format ("No response received after %s" , l ));
247
+ try {
248
+ asyncHandler .onThrowable (te );
249
+ } catch (Throwable t ) {
250
+ logger .debug ("asyncHandler.onThrowable" , t );
251
+ }
252
+ throw new ExecutionException (te );
250
253
} finally {
251
254
cancelReaper ();
252
- throw new ExecutionException (te );
253
255
}
254
256
}
255
257
}
@@ -278,12 +280,14 @@ V getContent() throws ExecutionException {
278
280
} catch (Throwable ex ) {
279
281
if (!throwableCalled .getAndSet (true )) {
280
282
try {
281
- asyncHandler .onThrowable (ex );
282
- } catch (Throwable t ) {
283
- logger .debug ("asyncHandler.onThrowable" , t );
283
+ try {
284
+ asyncHandler .onThrowable (ex );
285
+ } catch (Throwable t ) {
286
+ logger .debug ("asyncHandler.onThrowable" , t );
287
+ }
288
+ throw new RuntimeException (ex );
284
289
} finally {
285
290
cancelReaper ();
286
- throw new RuntimeException (ex );
287
291
}
288
292
}
289
293
}
0 commit comments