summaryrefslogtreecommitdiffstats
path: root/app/common/services
diff options
context:
space:
mode:
authorCamVan Nguyen <ctnguyen@us.ibm.com>2018-05-04 19:30:01 -0500
committerGunnar Mills <gmills@us.ibm.com>2018-05-22 13:53:56 +0000
commit7db0e9ac624aa0d9915b2e9488d2a19e932e6fda (patch)
tree2147e21ba887650be5788bf3084d5eedeff8973a /app/common/services
parentcd0440e7a089735e312314e9d30fda90ef8e1b8c (diff)
downloadphosphor-webui-7db0e9ac624aa0d9915b2e9488d2a19e932e6fda.tar.gz
phosphor-webui-7db0e9ac624aa0d9915b2e9488d2a19e932e6fda.zip
Do not abort when one of multiple promises fails
The goal is to load as much data as possible on the 'Server overview' page. In original code, multiple promises are executed in parallel using $q.all() to get data for the page. When any of the promises fails, the remaining promises are aborted. The fix is to write a method to resolve the promise returned from each of the APIUtils calls, which would set the scope variables, and pass the promise returned by it to $q.all instead. Resolves openbmc/openbmc#3151 Change-Id: I361c80ddd2665dbe43f8a635eda42ef2b5c0788c Signed-off-by: CamVan Nguyen <ctnguyen@us.ibm.com>
Diffstat (limited to 'app/common/services')
-rw-r--r--app/common/services/api-utils.js4
1 files changed, 1 insertions, 3 deletions
diff --git a/app/common/services/api-utils.js b/app/common/services/api-utils.js
index 6f81ce1..13f1406 100644
--- a/app/common/services/api-utils.js
+++ b/app/common/services/api-utils.js
@@ -1096,7 +1096,7 @@ window.angular && (function (angular) {
if ('Not Found' == error.statusText) {
return Constants.POWER_CONSUMPTION_TEXT.notavailable;
} else {
- console.log(error);
+ throw error;
}
});
},
@@ -1116,8 +1116,6 @@ window.angular && (function (angular) {
return (false == content.data.PowerCapEnable) ?
Constants.POWER_CAP_TEXT.disabled :
content.data.PowerCap + ' ' + Constants.POWER_CAP_TEXT.unit;
- }, function(error){
- console.log(error);
});
},
setHostname: function(hostname){
OpenPOWER on IntegriCloud