diff options
author | Sébastien Determe <sebastien.determe@intl.att.com> | 2020-04-21 12:27:17 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-04-21 12:27:17 +0000 |
commit | 8b9918e7e3b1398ece5470f36be1d9dd13e29bee (patch) | |
tree | 8d2607bf1a90a8b32bc2e3e65832453d9d030348 /ui-react/src/api | |
parent | dcfbed79c6da8b9c737c979b9a0410d37142499d (diff) | |
parent | c65613938d30565d4dc913fbf2d48002390119d3 (diff) |
Merge "Prevent adding same type of Op policy"
Diffstat (limited to 'ui-react/src/api')
-rw-r--r-- | ui-react/src/api/LoopService.js | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/ui-react/src/api/LoopService.js b/ui-react/src/api/LoopService.js index f10d187cb..3b9ed86fa 100644 --- a/ui-react/src/api/LoopService.js +++ b/ui-react/src/api/LoopService.js @@ -226,18 +226,17 @@ export default class LoopService { credentials: 'same-origin' }) .then(function (response) { - console.debug("Add Operational Policy response received: ", response.status); + console.debug("Add Operational Policy response received: ", response.status); if (response.ok) { return response.json(); } else { - console.error("Add Operational Policy query failed"); - return {}; + return response.text(); } }) - .catch(function (error) { - console.error("Add Operational Policy error received", error); - return {}; - }); + .then(function (object) { + console.error("Add Operational Policy query failed"); + throw new Error(object); + }) } static removeOperationalPolicyType(loopName, policyType, policyVersion, policyName) { |