summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Branca <chewbranca@gmail.com>2013-02-26 11:48:27 -0800
committerRussell Branca <chewbranca@gmail.com>2013-02-26 11:48:36 -0800
commit829db1ab39ad2a14b6b7a810fe947e47ea01eb66 (patch)
treeec07fed8602cccd6bd4246aa5cef2634eac3321b
parent6033ac3fb6929258c2d47be272d66f4729bcecd1 (diff)
downloadcouchdb-829db1ab39ad2a14b6b7a810fe947e47ea01eb66.tar.gz
Add initial error handling for view establish functions
-rw-r--r--src/fauxton/app/router.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/fauxton/app/router.js b/src/fauxton/app/router.js
index 94b72f66a..adfa96e75 100644
--- a/src/fauxton/app/router.js
+++ b/src/fauxton/app/router.js
@@ -70,7 +70,13 @@ function(req, app, Initialize, FauxtonAPI, Fauxton, Layout, Databases, Documents
_.each(settings.views, function(view, selector) {
masterLayout.setView(selector, view);
- $.when.apply(null, view.establish()).done(function(resp) {
+ $.when.apply(null, view.establish()).then(function(resp) {
+ masterLayout.renderView(selector);
+ }, function(resp) {
+ view.establishError = {
+ error: true,
+ reason: resp
+ };
masterLayout.renderView(selector);
});