Gracefully handle failed version check attempts
This issue what found by darkling, and reported on irc
This commit is contained in:
@@ -25,6 +25,7 @@ import org.apache.commons.io.IOUtils;
|
|||||||
import org.apache.http.client.ResponseHandler;
|
import org.apache.http.client.ResponseHandler;
|
||||||
import org.apache.http.client.config.RequestConfig;
|
import org.apache.http.client.config.RequestConfig;
|
||||||
import org.apache.http.client.methods.HttpGet;
|
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.BasicResponseHandler;
|
||||||
import org.apache.http.impl.client.CloseableHttpClient;
|
import org.apache.http.impl.client.CloseableHttpClient;
|
||||||
import org.apache.http.impl.client.HttpClients;
|
import org.apache.http.impl.client.HttpClients;
|
||||||
@@ -243,6 +244,9 @@ public class VersionService {
|
|||||||
try (CloseableHttpClient client = HttpClients.createDefault()) {
|
try (CloseableHttpClient client = HttpClients.createDefault()) {
|
||||||
ResponseHandler<String> responseHandler = new BasicResponseHandler();
|
ResponseHandler<String> responseHandler = new BasicResponseHandler();
|
||||||
content = client.execute(method, responseHandler);
|
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);
|
List<String> unsortedTags = JsonPath.read(content, JSON_PATH);
|
||||||
|
|||||||
Reference in New Issue
Block a user