Skip to content

Commit 94d228e

Browse files
author
Jessica Wang
committed
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).
1 parent 58f6cb6 commit 94d228e

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

ui/scripts/sharedFunctions.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,13 @@ function parseXMLHttpResponse(XMLHttpResponse) {
180180
if (json != null) {
181181
var property;
182182
for(property in json) {}
183-
var errorObj = json[property];
184-
return _s(errorObj.errortext);
185-
} else {
183+
var errorObj = json[property];
184+
if(errorObj.errorcode == 401 && errorObj.errortext == "unable to verify user credentials and/or request signature")
185+
return _l('label.session.expired');
186+
else
187+
return _s(errorObj.errortext);
188+
}
189+
else {
186190
return "";
187191
}
188192
}

0 commit comments

Comments
 (0)