summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Branca <chewbranca@gmail.com>2013-02-26 11:48:27 -0800
committerRussell Branca <chewbranca@gmail.com>2013-03-15 14:35:40 -0700
commit02ec66d3a1ce7cfb4ce941f789849f13f58696f3 (patch)
treef1b94384c4d61a31f137bfdaf1be12dfe89bd234
parentf86e0bb6af95cf3c9973218016398d70c72278ec (diff)
downloadcouchdb-02ec66d3a1ce7cfb4ce941f789849f13f58696f3.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 58ab2cf11..67743a47e 100644
--- a/src/fauxton/app/router.js
+++ b/src/fauxton/app/router.js
@@ -71,7 +71,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);
});