mirror of
https://github.com/apache/httpcomponents-client.git
synced 2025-02-10 12:05:58 +00:00
HTTPCLIENT-2314: Throw ConnectionShutdownException in case of pooled connection having been closed or discarded instead of plain IllegalStateException
This commit is contained in:
parent
f24c8010bb
commit
e2385f7d9a
@ -76,7 +76,6 @@
|
||||
import org.apache.hc.core5.pool.PoolStats;
|
||||
import org.apache.hc.core5.pool.StrictConnPool;
|
||||
import org.apache.hc.core5.util.Args;
|
||||
import org.apache.hc.core5.util.Asserts;
|
||||
import org.apache.hc.core5.util.Deadline;
|
||||
import org.apache.hc.core5.util.Identifiable;
|
||||
import org.apache.hc.core5.util.TimeValue;
|
||||
@ -673,7 +672,9 @@ PoolEntry<HttpRoute, ManagedHttpClientConnection> getPoolEntry() {
|
||||
PoolEntry<HttpRoute, ManagedHttpClientConnection> getValidatedPoolEntry() {
|
||||
final PoolEntry<HttpRoute, ManagedHttpClientConnection> poolEntry = getPoolEntry();
|
||||
final ManagedHttpClientConnection connection = poolEntry.getConnection();
|
||||
Asserts.check(connection != null && connection.isOpen(), "Endpoint is not connected");
|
||||
if (connection == null || !connection.isOpen()) {
|
||||
throw new ConnectionShutdownException();
|
||||
}
|
||||
return poolEntry;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user