GUACAMOLE-526: Handle rejections for absolutely all promises.

This commit is contained in:
Michael Jumper
2018-04-26 22:15:17 -07:00
parent f6d5e5662b
commit 266b445c21
23 changed files with 118 additions and 276 deletions

View File

@@ -37,6 +37,7 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
var guacNotification = $injector.get('guacNotification');
var iconService = $injector.get('iconService');
var preferenceService = $injector.get('preferenceService');
var requestService = $injector.get('requestService');
var tunnelService = $injector.get('tunnelService');
var userPageService = $injector.get('userPageService');
@@ -161,7 +162,9 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
name : "CLIENT.ACTION_LOGOUT",
className : "logout button",
callback : function logoutCallback() {
authenticationService.logout()['finally'](function logoutComplete() {
authenticationService.logout()
['catch'](requestService.IGNORE)
['finally'](function logoutComplete() {
$location.url('/');
});
}
@@ -188,7 +191,7 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
};
}
});
}, requestService.WARN);
/**
* Action which replaces the current client with a newly-connected client.
@@ -466,7 +469,7 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
tunnelService.getSharingProfiles(uuid)
.then(function sharingProfilesRetrieved(sharingProfiles) {
$scope.sharingProfiles = sharingProfiles;
});
}, requestService.WARN);
});
@@ -614,6 +617,7 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
// Re-authenticate to verify auth status at end of connection
authenticationService.updateCurrentToken($location.search())
['catch'](requestService.IGNORE)
// Show the requested status once the authentication check has finished
['finally'](function authenticationCheckComplete() {
@@ -714,7 +718,7 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
// Sync with local clipboard
clipboardService.getLocalClipboard().then(function clipboardRead(data) {
$scope.$broadcast('guacClipboard', data);
})['catch'](angular.noop);
}, angular.noop);
// Hide status notification
guacNotification.showStatus(false);