Skip to content

Commit 0ed825f

Browse files
authored
fix(apache): Treat all I/O exceptions as network errors (#791)
1 parent d72111a commit 0ed825f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

algoliasearch-apache/src/main/java/com/algolia/search/ApacheHttpRequester.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import java.util.concurrent.TimeoutException;
1414
import java.util.function.Consumer;
1515
import javax.annotation.Nonnull;
16-
import javax.net.ssl.SSLException;
1716
import org.apache.http.*;
1817
import org.apache.http.client.config.RequestConfig;
1918
import org.apache.http.client.entity.DeflateDecompressingEntity;
@@ -82,7 +81,7 @@ public CompletableFuture<HttpResponse> performRequestAsync(HttpRequest request)
8281
|| t.getCause() instanceof NoHttpResponseException) {
8382
return new HttpResponse(true);
8483
} else if (t.getCause() instanceof HttpException
85-
|| t.getCause() instanceof SSLException) {
84+
|| t.getCause() instanceof IOException) {
8685
return new HttpResponse().setNetworkError(true);
8786
}
8887
throw new AlgoliaRuntimeException(t);

0 commit comments

Comments
 (0)