Skip to content
This repository has been archived by the owner on Jan 24, 2023. It is now read-only.

Swallow failed get org/space summary promises #475

Merged
merged 1 commit into from
Jul 21, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/app/view/endpoints/clusters/cluster/cluster.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,15 @@

// Cache all organizations associated with this cluster
var orgPromise = organizationModel.listAllOrganizations(that.guid, {}).then(function (orgs) {
var detailsPromises = [];
var promises = [];
_.forEach(orgs, function (org) {
detailsPromises.push(organizationModel.getOrganizationDetails(that.guid, org));
var promise = organizationModel.getOrganizationDetails(that.guid, org).catch(function () {
//Swallow errors for individual orgs
$log.error('Failed to fetch details for org - ' + org.entity.name);
});
promises.push(promise);
});
return $q.all(detailsPromises);
return $q.all(promises);
}).catch(function (error) {
$log.error('Error while listing organizations', error);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@
'$stateParams',
'$state',
'app.utils.utilsService',
'$q'
'$q',
'$log'
];

function ClusterOrgController(modelManager, $stateParams, $state, utils, $q) {
function ClusterOrgController(modelManager, $stateParams, $state, utils, $q, $log) {
var that = this;

this.clusterGuid = $stateParams.guid;
Expand All @@ -43,7 +44,11 @@
function init() {
var promises = [];
_.forEach(_.get(that.organizationModel, that.spacesPath), function (space) {
promises.push(that.spaceModel.getSpaceDetails(that.clusterGuid, space));
var promise = that.spaceModel.getSpaceDetails(that.clusterGuid, space).catch(function () {
//Swallow errors for individual spaces
$log.error('Failed to fetch details for space - ' + space.entity.name);
});
promises.push(promise);
});
return $q.all(promises);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
}
},
{
name: gettext('Assign User(sa)'),
name: gettext('Assign User(s)'),
disabled: true,
execute: function () {
}
Expand Down