File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
src/main/java/org/terasology/launcher/repositories Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 1111import org .kohsuke .github .GHRepository ;
1212import org .kohsuke .github .GitHub ;
1313import org .kohsuke .github .GitHubBuilder ;
14+ import org .kohsuke .github .HttpException ;
1415import org .kohsuke .github .extras .okhttp3 .OkHttpConnector ;
1516import org .slf4j .Logger ;
1617import org .slf4j .LoggerFactory ;
@@ -40,7 +41,14 @@ public GithubRepositoryAdapter(final OkHttpClient httpClient) {
4041 .withConnector (new OkHttpConnector (httpClient ))
4142 .build ();
4243 logger .debug ("Github rate limit: {}" , github .getRateLimit ());
44+ } catch (HttpException e ) {
45+ if (e .getResponseCode () == -1 ) { // NOPMD
46+ // no internet connection, do nothing
47+ } else {
48+ e .printStackTrace ();
49+ }
4350 } catch (IOException e ) {
51+
4452 e .printStackTrace ();
4553 }
4654 }
@@ -83,6 +91,12 @@ public List<GameRelease> fetchReleases() {
8391 .collect (Collectors .toList ());
8492 logger .debug ("Github rate limit: {}" , github .getRateLimit ());
8593 return releases ;
94+ } catch (HttpException e ) {
95+ if (e .getResponseCode () == -1 ) { // NOPMD
96+ // no internet connection, do nothing
97+ } else {
98+ e .printStackTrace ();
99+ }
86100 } catch (IOException e ) {
87101 e .printStackTrace ();
88102 }
You can’t perform that action at this time.
0 commit comments