Merge pull request #130 from jcabrerizo/fixEntitlementMSGs

Fix entitlement messages
diff --git a/ui-modules/app-inspector/app/components/providers/entity-api.provider.js b/ui-modules/app-inspector/app/components/providers/entity-api.provider.js
index 0f5e18c..6003474 100644
--- a/ui-modules/app-inspector/app/components/providers/entity-api.provider.js
+++ b/ui-modules/app-inspector/app/components/providers/entity-api.provider.js
@@ -167,7 +167,7 @@
         return $http.post('/v1/applications/'+ applicationId +'/entities/' + entityId + '/adjuncts/' + adjunctId + '/stop');
     }
     function destroyEntityAdjunct(applicationId, entityId, adjunctId) {
-        return $http.post('/v1/applications/'+ applicationId +'/entities/' + entityId + '/adjuncts/' + adjunctId + '/destroy');
+        return $http.delete('/v1/applications/'+ applicationId +'/entities/' + entityId + '/adjuncts/' + adjunctId);
     }
     function updateEntityAdjunctConfig(applicationId, entityId, adjunctId, configId, data) {
         return $http.post('/v1/applications/'+ applicationId +'/entities/' + entityId + '/adjuncts/' + adjunctId + '/config/' + configId, data);
diff --git a/ui-modules/app-inspector/app/views/main/inspect/summary/summary.controller.js b/ui-modules/app-inspector/app/views/main/inspect/summary/summary.controller.js
index 5c30829..51b0af3 100644
--- a/ui-modules/app-inspector/app/views/main/inspect/summary/summary.controller.js
+++ b/ui-modules/app-inspector/app/views/main/inspect/summary/summary.controller.js
@@ -188,7 +188,8 @@
             entityApi.updateEntityName(applicationId, entityId, this.name).then((response)=> {
                 vm.entity.name = vm.name;
             }).catch((error)=> {
-                brSnackbar.create('Cannot update entity name: the entity [' + entityId + '] is undefined');
+                let errorMessage= ('undefined' === typeof error.message)? error.error.message: error.message;
+                brSnackbar.create('Cannot update entity name: ' + errorMessage);
                 vm.name = vm.entity.name;
             });
         }
diff --git a/ui-modules/catalog/app/views/bundle/bundle.state.js b/ui-modules/catalog/app/views/bundle/bundle.state.js
index dd6e248..8323050 100644
--- a/ui-modules/catalog/app/views/bundle/bundle.state.js
+++ b/ui-modules/catalog/app/views/bundle/bundle.state.js
@@ -77,7 +77,8 @@
         catalogApi.deleteBundle($scope.bundle.symbolicName, $scope.bundle.version).then(data => {
             $state.go(catalogState);
         }).catch(error => {
-            brSnackbar.create('Could not delete this bundle: ' + error.message);
+            let errorMessage= ('undefined' === typeof error.message)? error.error.message: error.message;
+            brSnackbar.create('Could not delete this bundle: ' + errorMessage);
         }).finally(() => {
             $scope.state.deleting = false;
         });
@@ -103,7 +104,8 @@
         $scope.bundleVersions = bundleVersions.map(bundleVersion => bundleVersion.version);
         $scope.$emit(HIDE_INTERSTITIAL_SPINNER_EVENT);
     }).catch(error => {
-        brSnackbar.create(`Could not load bundle ${$stateParams.bundleId}:${$stateParams.bundleVersion}: ${error.status === 404 ? 'Not found' : error.message}`);
+        let errorMessage= ('undefined' === typeof error.message)? error.error.message: error.message;
+        brSnackbar.create(`Could not load bundle ${$stateParams.bundleId}:${$stateParams.bundleVersion}: ${error.status === 404 ? 'Not found' : errorMessage}`);
         $state.go(catalogState);
     });
 }