You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ga...@apache.org on 2014/03/26 09:14:25 UTC
couchdb commit: updated refs/heads/master to 827b848
Repository: couchdb
Updated Branches:
refs/heads/master 1fb7cea25 -> 827b84891
Readd 'Could not create admin.' to the beginning of the error message
was removed in b63ff1b50b7bde0c8f1f95988d076dda63f41fed
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/827b8489
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/827b8489
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/827b8489
Branch: refs/heads/master
Commit: 827b84891d5c16a4e5c2b692d3694fe2ba4a1210
Parents: 1fb7cea
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Tue Mar 25 22:05:19 2014 +0100
Committer: Garren Smith <ga...@gmail.com>
Committed: Wed Mar 26 10:17:51 2014 +0200
----------------------------------------------------------------------
src/fauxton/app/addons/auth/resources.js | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb/blob/827b8489/src/fauxton/app/addons/auth/resources.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/auth/resources.js b/src/fauxton/app/addons/auth/resources.js
index edfd708..ba3a438 100644
--- a/src/fauxton/app/addons/auth/resources.js
+++ b/src/fauxton/app/addons/auth/resources.js
@@ -20,7 +20,7 @@ function (app, FauxtonAPI, CouchdbSession) {
var Auth = new FauxtonAPI.addon();
- var promiseErrorHandler = function (xhr, type, msg) {
+ var errorHandler = function (xhr, type, msg) {
msg = xhr;
if (arguments.length === 3) {
msg = xhr.responseJSON.reason;
@@ -72,7 +72,8 @@ function (app, FauxtonAPI, CouchdbSession) {
passwordsNotMatch: 'Passwords do not match.',
loggedIn: 'You have been logged in.',
adminCreated: 'CouchDB admin created',
- changePassword: 'Your password has been updated.'
+ changePassword: 'Your password has been updated.',
+ adminCreationFailedPrefix: 'Could not create admin.'
}, options.messages);
},
@@ -245,7 +246,14 @@ function (app, FauxtonAPI, CouchdbSession) {
}
});
- promise.fail(promiseErrorHandler);
+ promise.fail(function (xhr, type, msg) {
+ msg = xhr;
+ if (arguments.length === 3) {
+ msg = xhr.responseJSON.reason;
+ }
+ msg = FauxtonAPI.session.messages.adminCreationFailedPrefix + ' ' + msg;
+ errorHandler(msg);
+ });
}
});
@@ -279,7 +287,7 @@ function (app, FauxtonAPI, CouchdbSession) {
FauxtonAPI.navigate('/');
});
- promise.fail(promiseErrorHandler);
+ promise.fail(errorHandler);
}
});
@@ -306,7 +314,7 @@ function (app, FauxtonAPI, CouchdbSession) {
that.$('#password-confirm').val('');
});
- promise.fail(promiseErrorHandler);
+ promise.fail(errorHandler);
}
});