Gracefully handle failed version check attempts

This issue what found by darkling, and reported on irc
This commit is contained in:
jvoisin
2019-09-19 19:54:58 +00:00
committed by GitHub
parent b02fd9ad6c
commit 3d8f3ed21d
@@ -25,6 +25,7 @@ import org.apache.commons.io.IOUtils;
import org.apache.http.client.ResponseHandler;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.conn.ConnectTimeoutException;
import org.apache.http.impl.client.BasicResponseHandler;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
@@ -243,6 +244,9 @@ public class VersionService {
try (CloseableHttpClient client = HttpClients.createDefault()) {
ResponseHandler<String> responseHandler = new BasicResponseHandler();
content = client.execute(method, responseHandler);
} catch (ConnectTimeoutException e) {
LOG.warn("Got a timeout when trying to reach {}", VERSION_URL);
return;
}
List<String> unsortedTags = JsonPath.read(content, JSON_PATH);