try {
String yaml = connection.post("/api/backends/list", "", "app_id", app.getAppId());
if (yaml.contains("No backends configured")) {
return Collections.<BackendsXml.Entry>emptyList();
} else {
BackendsXml xml = BackendsYamlReader.parse(yaml);
return xml.getBackends();
}
} catch (Throwable t) {
errorWriter.println("Unable to list backends:");
t.printStackTrace(errorWriter);
throw new AdminException("Unable to list backends: " + t.getMessage(), t);