Adding error logs when unexpected error from gateway

revert-70aa11f8
Rasika Perera 8 years ago
parent 54d25522ba
commit 139bc99cc7

@ -259,6 +259,10 @@ deviceModule = function () {
} }
return serviceInvokers.XMLHttp.get( return serviceInvokers.XMLHttp.get(
url, function (responsePayload) { url, function (responsePayload) {
if(!responsePayload["responseText"]){
log.error("Error while fetching device count. API `" + url + "` returns HTTP: " + responsePayload["status"]);
throw constants["ERRORS"]["UNKNOWN_ERROR"];
}
return parse(responsePayload["responseText"])["count"]; return parse(responsePayload["responseText"])["count"];
}, },
function (responsePayload) { function (responsePayload) {

@ -47,7 +47,8 @@ var LANGUAGE_US = "en_US";
var VENDOR_APPLE = "Apple"; var VENDOR_APPLE = "Apple";
var ERRORS = { var ERRORS = {
"USER_NOT_FOUND": "USER_NOT_FOUND" "USER_NOT_FOUND": "USER_NOT_FOUND",
"UNKNOWN_ERROR": "Unknown Error"
}; };
var USER_STORES_NOISY_CHAR = "\""; var USER_STORES_NOISY_CHAR = "\"";

Loading…
Cancel
Save