Always construct new exception on error in DefaultWebClient

Always construct new exception on error, otherwise memory leak may
occur due to repeated use of singleton exception.

Closes gh-28550
This commit is contained in:
Balázs Póka
2022-06-01 02:13:32 +02:00
committed by Sam Brannen
parent c55606ed08
commit 1d5ffaf30a

View File

@@ -68,7 +68,7 @@ class DefaultWebClient implements WebClient {
private static final String URI_TEMPLATE_ATTRIBUTE = WebClient.class.getName() + ".uriTemplate";
private static final Mono<ClientResponse> NO_HTTP_CLIENT_RESPONSE_ERROR = Mono.error(
new IllegalStateException("The underlying HTTP client completed without emitting a response."));
() -> new IllegalStateException("The underlying HTTP client completed without emitting a response."));
private final ExchangeFunction exchangeFunction;