BROOKLYN-244: Add error handling if the applications' fetch fails
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 @@
}
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();
});
}
}