401 error alert

This commit is contained in:
Mo Bitar
2018-06-19 18:59:37 -05:00
parent 63d4a859df
commit 40ffa5f7b0
3 changed files with 8 additions and 6 deletions

View File

@@ -45,7 +45,7 @@ class HttpManager {
} else {
console.error("Request error:", response);
this.$timeout(function(){
onerror(response)
onerror(response, xmlhttp.status)
})
}
}

View File

@@ -411,7 +411,7 @@ class SyncManager {
) {
this.$rootScope.$broadcast("major-data-change");
}
this.callQueuedCallbacksAndCurrent(callback, response);
this.$rootScope.$broadcast("sync:completed", {retrievedItems: this.allRetreivedItems, savedItems: this.allSavedItems});
@@ -429,7 +429,10 @@ class SyncManager {
console.log("Caught sync success exception:", e);
}
}.bind(this), function(response){
}.bind(this), function(response, statusCode){
if(statusCode == 401) {
alert("Your session has expired. New changes will not be pulled in. Please sign out and sign back in to refresh your session.");
}
console.log("Sync error: ", response);
var error = response ? response.error : {message: "Could not connect to server."};