You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ch...@apache.org on 2013/03/15 17:53:44 UTC

[8/27] git commit: Add initial error handling for view establish functions

Add initial error handling for view establish functions


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/829db1ab
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/829db1ab
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/829db1ab

Branch: refs/heads/fauxton
Commit: 829db1ab39ad2a14b6b7a810fe947e47ea01eb66
Parents: 6033ac3
Author: Russell Branca <ch...@gmail.com>
Authored: Tue Feb 26 11:48:27 2013 -0800
Committer: Russell Branca <ch...@gmail.com>
Committed: Tue Feb 26 11:48:36 2013 -0800

----------------------------------------------------------------------
 src/fauxton/app/router.js |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/829db1ab/src/fauxton/app/router.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/router.js b/src/fauxton/app/router.js
index 94b72f6..adfa96e 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);
           });