mirror of https://github.com/apache/cloudstack.git
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:
parent
58f6cb6eee
commit
94d228eaa7
|
|
@ -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 "";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue