Return-Path: X-Original-To: apmail-ignite-commits-archive@minotaur.apache.org Delivered-To: apmail-ignite-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B8E421764D for ; Sun, 6 Sep 2015 15:53:59 +0000 (UTC) Received: (qmail 10301 invoked by uid 500); 6 Sep 2015 15:53:59 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 10272 invoked by uid 500); 6 Sep 2015 15:53:59 -0000 Mailing-List: contact commits-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list commits@ignite.apache.org Received: (qmail 10223 invoked by uid 99); 6 Sep 2015 15:53:59 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 06 Sep 2015 15:53:59 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 6EB90DFE2E; Sun, 6 Sep 2015 15:53:59 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: akuznetsov@apache.org To: commits@ignite.apache.org Date: Sun, 06 Sep 2015 15:53:59 -0000 Message-Id: <8c1623ee2abd4ff1b09bf918e7be4471@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/2] ignite git commit: IGNITE-843 Added check for not found account. Repository: ignite Updated Branches: refs/heads/ignite-843 ce1559bc8 -> e2fc78ee0 IGNITE-843 Added check for not found account. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/ae9450dd Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/ae9450dd Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/ae9450dd Branch: refs/heads/ignite-843 Commit: ae9450dddf52d51d1c11d760c9a45c837dd87ed9 Parents: ce1559b Author: AKuznetsov Authored: Sun Sep 6 22:51:43 2015 +0700 Committer: AKuznetsov Committed: Sun Sep 6 22:51:43 2015 +0700 ---------------------------------------------------------------------- .../src/main/js/agents/agent-manager.js | 21 ++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/ae9450dd/modules/control-center-web/src/main/js/agents/agent-manager.js ---------------------------------------------------------------------- diff --git a/modules/control-center-web/src/main/js/agents/agent-manager.js b/modules/control-center-web/src/main/js/agents/agent-manager.js index 2689be2..d37b629 100644 --- a/modules/control-center-web/src/main/js/agents/agent-manager.js +++ b/modules/control-center-web/src/main/js/agents/agent-manager.js @@ -121,19 +121,17 @@ function Client(ws, manager) { * @param {Function} [cb] Callback. Take 3 arguments: {String} error, {number} httpCode, {string} response. */ Client.prototype.executeRest = function(path, params, method, headers, body, cb) { - var self = this; - if (typeof(params) != 'object') - throw "'params' argument must be an object"; + throw '"params" argument must be an object'; if (typeof(cb) != 'function') - throw "callback must be a function"; + throw 'callback must be a function'; if (body && typeof(body) != 'string') - throw "body must be a string"; + throw 'body must be a string'; if (headers && typeof(headers) != 'object') - throw "headers must be an object"; + throw 'headers must be an object'; if (!method) method = 'GET'; @@ -141,7 +139,7 @@ Client.prototype.executeRest = function(path, params, method, headers, body, cb) method = method.toUpperCase(); if (method != 'GET' && method != 'POST') - throw "Unknown HTTP method: " + method; + throw 'Unknown HTTP method: ' + method; var newArgs = argsToArray(arguments); @@ -230,9 +228,12 @@ Client.prototype._invokeRmtMethod = function(methodName, args) { Client.prototype._rmtAuthMessage = function(msg) { var self = this; - var account = db.Account.findByUsername(msg.login, function(err, account) { + db.Account.findByUsername(msg.login, function(err, account) { if (err) { - self.authResult("User not found"); + self.authResult(err); + } + else if (!account) { + self.authResult('User not found'); } else { account.authenticate(msg.password, function(err, user, res) { @@ -303,7 +304,7 @@ var manager = null; exports.createManager = function(srv) { if (manager) - throw "Agent manager already cleared!"; + throw 'Agent manager already cleared!'; manager = new AgentManager(srv); };