brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aleds...@apache.org
Subject [2/2] brooklyn-ui git commit: BROOKLYN-244: Add error handling if the applications' fetch fails
Date Wed, 06 Apr 2016 15:39:42 GMT
BROOKLYN-244: Add error handling if the applications' fetch fails


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/commit/288e2447
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/tree/288e2447
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/diff/288e2447

Branch: refs/heads/0.9.0
Commit: 288e2447e9c00e8671fc802bab2e6d466921d9a0
Parents: a88f781
Author: Thomas Bouron <thomas.bouron@cloudsoftcorp.com>
Authored: Wed Apr 6 12:35:12 2016 +0100
Committer: Aled Sage <aled.sage@gmail.com>
Committed: Wed Apr 6 16:39:18 2016 +0100

----------------------------------------------------------------------
 src/main/webapp/assets/js/view/editor.js | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/288e2447/src/main/webapp/assets/js/view/editor.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/view/editor.js b/src/main/webapp/assets/js/view/editor.js
index 05469d1..72ce9f4 100644
--- a/src/main/webapp/assets/js/view/editor.js
+++ b/src/main/webapp/assets/js/view/editor.js
@@ -185,11 +185,14 @@ define([
                                 }
 
                                 cm.getDoc().setValue(itemText);
-                                cm.setOption('readOnly', false);
-                                cm.refresh();
-
-                                loading.fadeOut();
+                            },
+                            error: function() {
+                                vm.showFailure('Could not load the item: ' + vm.options.typeId);
                             }
+                        }).done(function() {
+                            cm.setOption('readOnly', false);
+                            cm.refresh();
+                            loading.fadeOut();
                         });
                     }
                 }


Mime
View raw message