fix error message when cannot validate ldap connection

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1448674 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2013-02-21 14:57:40 +00:00
parent 08c68fe7f0
commit f8ae2f2f25
1 changed files with 23 additions and 12 deletions

View File

@ -1439,14 +1439,20 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout"
displaySuccessMessage(message); displaySuccessMessage(message);
}, },
error: function(data) { error: function(data) {
var res = $.parseJSON(data.responseText); try{
displayRestError(res); var res = $.parseJSON(data.responseText);
}, displayRestError(res);
complete:function(data){ }catch (e){
removeMediumSpinnerImg(userMessages); displayErrorMessage( $.i18n.prop("error.500"));
btn.button('reset'); }
} }
} }
).always(
function(data){
removeMediumSpinnerImg(userMessages);
btn.button('reset');
}
); );
} }
@ -1468,14 +1474,19 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout"
displaySuccessMessage(message); displaySuccessMessage(message);
}, },
error: function(data) { error: function(data) {
var res = $.parseJSON(data.responseText); try{
displayRestError(res); var res = $.parseJSON(data.responseText);
}, displayRestError(res);
complete:function(data){ }catch (e){
removeMediumSpinnerImg(userMessages); displayErrorMessage( $.i18n.prop("error.500"));
btn.button('reset'); }
} }
} }
).always(
function(data){
removeMediumSpinnerImg(userMessages);
btn.button('reset');
}
); );
} }