improved error handling on portal details response handler
This commit is contained in:
parent
a2eeedd0c6
commit
9f9609f7e9
@ -50,6 +50,10 @@ var handleResponse = function(guid, data, success) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (data.error || !data.result) {
|
||||||
|
success = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (success) {
|
if (success) {
|
||||||
var dict = {
|
var dict = {
|
||||||
raw: data.result,
|
raw: data.result,
|
||||||
@ -75,9 +79,18 @@ var handleResponse = function(guid, data, success) {
|
|||||||
if (guid == selectedPortal) {
|
if (guid == selectedPortal) {
|
||||||
renderPortalDetails(guid);
|
renderPortalDetails(guid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
window.runHooks ('portalDetailLoaded', {guid:guid, success:success, details:dict});
|
||||||
|
|
||||||
|
} else {
|
||||||
|
if (data.error == "RETRY") {
|
||||||
|
// server asked us to try again
|
||||||
|
portalDetail.request(guid);
|
||||||
|
} else {
|
||||||
|
window.runHooks ('portalDetailLoaded', {guid:guid, success:success});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
window.runHooks ('portalDetailLoaded', {guid:guid, success:success, details:dict});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
window.portalDetail.request = function(guid) {
|
window.portalDetail.request = function(guid) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user