Created
October 2, 2017 16:38
-
-
Save chirino/723b2ebe2f85e2ce91e60879416d56a1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/main/java/io/openshift/launchpad/MissionControl.java b/src/main/java/io/openshift/launchpad/MissionControl.java | |
index eb2412b..5b7b883 100644 | |
--- a/src/main/java/io/openshift/launchpad/MissionControl.java | |
+++ b/src/main/java/io/openshift/launchpad/MissionControl.java | |
@@ -10,6 +10,7 @@ package io.openshift.launchpad; | |
import java.net.ConnectException; | |
import java.net.URI; | |
import java.net.UnknownHostException; | |
+import java.util.Collections; | |
import java.util.List; | |
import java.util.function.Function; | |
@@ -215,13 +216,16 @@ public class MissionControl | |
public List<String> getOpenShiftClusters(String authHeader) | |
{ | |
URI targetURI = UriBuilder.fromUri(missionControlOpenShiftURI).path("/clusters").build(); | |
- return perform(client -> client | |
- .target(targetURI) | |
- .request(MediaType.APPLICATION_JSON_TYPE) | |
- .header(HttpHeaders.AUTHORIZATION, authHeader) | |
- .get().readEntity(new GenericType<List<String>>() | |
- { | |
- })); | |
+ try { | |
+ return perform(client -> client | |
+ .target(targetURI) | |
+ .request(MediaType.APPLICATION_JSON_TYPE) | |
+ .header(HttpHeaders.AUTHORIZATION, authHeader) | |
+ .get().readEntity(new GenericType<List<String>>() { | |
+ })); | |
+ } catch (Exception e) { | |
+ return Collections.emptyList(); | |
+ } | |
} | |
public List<String> getProjects(String authHeader, String cluster) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment