Gracefully handle failed version check attempts

This issue what found by darkling, and reported on irc
master
jvoisin 5 years ago committed by GitHub
parent b02fd9ad6c
commit 3d8f3ed21d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      airsonic-main/src/main/java/org/airsonic/player/service/VersionService.java

@ -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);

Loading…
Cancel
Save