cloudstack 3.0 UI - When API returns an error whose errorcode is 401, show Session Timeout message instead of errortext in API response ("unable to verify user credentials and/or request signature"). So it will be clear to user what to do next (i.e. log out and log in again).

This commit is contained in:
Jessica Wang 2012-05-14 13:51:29 -07:00
parent 58f6cb6eee
commit 94d228eaa7
1 changed files with 7 additions and 3 deletions

View File

@ -180,9 +180,13 @@ function parseXMLHttpResponse(XMLHttpResponse) {
if (json != null) {
var property;
for(property in json) {}
var errorObj = json[property];
return _s(errorObj.errortext);
} else {
var errorObj = json[property];
if(errorObj.errorcode == 401 && errorObj.errortext == "unable to verify user credentials and/or request signature")
return _l('label.session.expired');
else
return _s(errorObj.errortext);
}
else {
return "";
}
}