jathanasiou commented on a change in pull request #245:
URL: https://github.com/apache/brooklyn-ui/pull/245#discussion_r668019778



##########
File path: ui-modules/utils/quick-launch/quick-launch.js
##########
@@ -147,23 +144,33 @@ export function quickLaunchDirective() {
         function deployApp() {
             $scope.deploying = true;
 
-            Promise.resolve(buildYaml()).then(appYaml => {
-                quickLaunch.planSender(appYaml)
-                    .then((response) => {
-                        if ($scope.callback) {
-                            $scope.callback.apply({}, [{state: 'SUCCESS', 
data: response.data}]);
-                        } else {
-                            brSnackbar.create('Application Deployed');
-                        }
-                        $scope.deploying = false;
-                    })
-                    .catch((err) => {
-                        $scope.model.deployError = err.data.message;
-                        $scope.deploying = false;
-                    });
-            });
+            Promise.resolve(buildYaml())
+                .then(appYaml => {
+                    quickLaunch.planSender(appYaml)
+                        .then((response) => {
+                            if ($scope.callback) {
+                                $scope.callback.apply({}, [{state: 'SUCCESS', 
data: response.data}]);
+                            } else {
+                                brSnackbar.create('Application Deployed');
+                            }
+                            $scope.deploying = false;
+                        })
+                        .catch(({ data }) => {
+                            // handling API error
+                            handleDeployError({ message: data.message });

Review comment:
       It seems like it could but we're essentially dealing with an http call 
error and having it mimick a generic `throw 'my message` `Error` object 
structure. So, it might be best to leave for transparency? I don't mind either 
way.

##########
File path: ui-modules/utils/quick-launch/quick-launch.js
##########
@@ -276,7 +281,7 @@ export function quickLaunchDirective() {
                         newApp[BROOKLYN_CONFIG] = newConfig;
                     }
                 }
-                
+
                 // prefer to use the actual yaml input, but if it's not 
possible
                 let tryMergeByConcatenate =
                     Object.keys(newApp).length ?

Review comment:
       Added a simple `console.error` since the typical `model.deployError` 
prop serves a different purpose and this case is controlled enough that it 
should generally not be able to fail (Form > yaml text generation). Further 
ideas would be welcome though.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to