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) {
try{
var res = $.parseJSON(data.responseText); var res = $.parseJSON(data.responseText);
displayRestError(res); displayRestError(res);
}, }catch (e){
complete:function(data){ displayErrorMessage( $.i18n.prop("error.500"));
}
}
}
).always(
function(data){
removeMediumSpinnerImg(userMessages); removeMediumSpinnerImg(userMessages);
btn.button('reset'); 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) {
try{
var res = $.parseJSON(data.responseText); var res = $.parseJSON(data.responseText);
displayRestError(res); displayRestError(res);
}, }catch (e){
complete:function(data){ displayErrorMessage( $.i18n.prop("error.500"));
}
}
}
).always(
function(data){
removeMediumSpinnerImg(userMessages); removeMediumSpinnerImg(userMessages);
btn.button('reset'); btn.button('reset');
} }
}
); );
} }