From 7621867ee0715afd598a1b0d7efa1054852e26fd Mon Sep 17 00:00:00 2001 From: Brian Federle Date: Mon, 2 Jul 2012 10:54:48 -0700 Subject: [PATCH] CS-15313: Error handling for account section This fixes an issue where an error is not displayed when entering an invalid account name. Original patch by: Pranav Saxena reviewed-by: Brian Federle --- ui/scripts/accounts.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ui/scripts/accounts.js b/ui/scripts/accounts.js index 9b565c62d90..525ee5947f4 100644 --- a/ui/scripts/accounts.js +++ b/ui/scripts/accounts.js @@ -173,7 +173,7 @@ action: function(args) { var array1 = []; array1.push("&username=" + todb(args.data.username)); - + var errorMsg = ""; var password = args.data.password; if (md5Hashed) password = $.md5(password); @@ -262,6 +262,7 @@ edit: { label: 'message.edit.account', action: function(args) { + var errorMsg = ""; var accountObj = args.context.accounts[0]; var array1 = []; @@ -273,7 +274,12 @@ async: false, success: function(json) { accountObj = json.updateaccountresponse.account; + }, + error: function(json) { + errorMsg = parseXMLHttpResponse(json); + args.response.error(errorMsg); } + }); $.ajax({ @@ -321,6 +327,7 @@ } }); + if(errorMsg == "") args.response.success({data: accountObj}); } },