Skip to content

Commit e3c602c

Browse files
committed
Polishing
Restore thread interrupted status in JettyClientHttpRequest
1 parent 02e9209 commit e3c602c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

spring-web/src/main/java/org/springframework/http/client/JettyClientHttpRequest.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,11 @@ protected ClientHttpResponse executeInternal(HttpHeaders headers, @Nullable Body
9595
Response response = responseListener.get(TimeUnit.MILLISECONDS.convert(this.timeOut), TimeUnit.MILLISECONDS);
9696
return new JettyClientHttpResponse(response, responseListener.getInputStream());
9797
}
98-
catch (InterruptedException | TimeoutException | ExecutionException ex) {
98+
catch (InterruptedException ex) {
99+
Thread.currentThread().interrupt();
100+
throw new IOException("Request was interrupted: " + ex.getMessage(), ex);
101+
}
102+
catch (TimeoutException | ExecutionException ex) {
99103
throw new IOException("Could not send request: " + ex.getMessage(), ex);
100104
}
101105
}

0 commit comments

Comments
 (0)