Support more generic Socket Exceptions

For instance: connection reset by peer
This commit is contained in:
Victor Martinez
2020-01-23 20:28:57 +00:00
parent 4f38ab3640
commit cbe1022f20

View File

@@ -904,8 +904,7 @@ class Requester {
// don't wrap exception in HttpException to preserve backward compatibility
throw e;
} catch (IOException e) {
if (((e instanceof SocketException && e.getCause() instanceof SocketTimeoutException)
|| e instanceof SocketTimeoutException) && timeouts > 0) {
if ((e instanceof SocketException || e instanceof SocketTimeoutException) && timeouts > 0) {
LOGGER.log(INFO,
"timed out accessing " + uc.getURL() + ". Sleeping 5 seconds before retrying... ; will try"
+ timeouts + " more time(s)",