mirror of
				https://github.com/gyurix1968/guacamole-client.git
				synced 2025-10-31 09:03:21 +00:00 
			
		
		
		
	GUACAMOLE-526: Handle rejections for absolutely all promises.
This commit is contained in:
		| @@ -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); | ||||
|   | ||||
| @@ -272,7 +272,7 @@ angular.module('client').directive('guacFileBrowser', [function guacFileBrowser( | ||||
|  | ||||
|                 }); | ||||
|  | ||||
|             }); // end retrieve file template | ||||
|             }, angular.noop); // end retrieve file template | ||||
|  | ||||
|             // Refresh file browser when any upload completes | ||||
|             $scope.$on('guacUploadComplete', function uploadComplete(event, filename) { | ||||
|   | ||||
| @@ -42,6 +42,7 @@ angular.module('client').factory('ManagedClient', ['$rootScope', '$injector', | ||||
|     var authenticationService  = $injector.get('authenticationService'); | ||||
|     var connectionGroupService = $injector.get('connectionGroupService'); | ||||
|     var connectionService      = $injector.get('connectionService'); | ||||
|     var requestService         = $injector.get('requestService'); | ||||
|     var tunnelService          = $injector.get('tunnelService'); | ||||
|     var guacAudio              = $injector.get('guacAudio'); | ||||
|     var guacHistory            = $injector.get('guacHistory'); | ||||
| @@ -514,7 +515,7 @@ angular.module('client').factory('ManagedClient', ['$rootScope', '$injector', | ||||
|             connectionService.getConnection(clientIdentifier.dataSource, clientIdentifier.id) | ||||
|             .then(function connectionRetrieved(connection) { | ||||
|                 managedClient.name = managedClient.title = connection.name; | ||||
|             }); | ||||
|             }, requestService.WARN); | ||||
|         } | ||||
|          | ||||
|         // If using a connection group, pull connection name | ||||
| @@ -522,7 +523,7 @@ angular.module('client').factory('ManagedClient', ['$rootScope', '$injector', | ||||
|             connectionGroupService.getConnectionGroup(clientIdentifier.dataSource, clientIdentifier.id) | ||||
|             .then(function connectionGroupRetrieved(group) { | ||||
|                 managedClient.name = managedClient.title = group.name; | ||||
|             }); | ||||
|             }, requestService.WARN); | ||||
|         } | ||||
|  | ||||
|         return managedClient; | ||||
| @@ -634,7 +635,7 @@ angular.module('client').factory('ManagedClient', ['$rootScope', '$injector', | ||||
|         credentialRequest.then(function sharingCredentialsReceived(sharingCredentials) { | ||||
|             client.shareLinks[sharingProfile.identifier] = | ||||
|                 ManagedShareLink.getInstance(sharingProfile, sharingCredentials); | ||||
|         }); | ||||
|         }, requestService.WARN); | ||||
|  | ||||
|         return credentialRequest; | ||||
|  | ||||
|   | ||||
| @@ -28,7 +28,8 @@ angular.module('client').factory('ManagedFileUpload', ['$rootScope', '$injector' | ||||
|     var ManagedFileTransferState = $injector.get('ManagedFileTransferState'); | ||||
|  | ||||
|     // Required services | ||||
|     var tunnelService = $injector.get('tunnelService'); | ||||
|     var requestService = $injector.get('requestService'); | ||||
|     var tunnelService  = $injector.get('tunnelService'); | ||||
|  | ||||
|     /** | ||||
|      * Object which serves as a surrogate interface, encapsulating a Guacamole | ||||
| @@ -171,7 +172,7 @@ angular.module('client').factory('ManagedFileUpload', ['$rootScope', '$injector' | ||||
|             }, | ||||
|  | ||||
|             // Notify if upload fails | ||||
|             function uploadFailed(error) { | ||||
|             requestService.createErrorCallback(function uploadFailed(error) { | ||||
|  | ||||
|                 // Use provide status code if the error is coming from the stream | ||||
|                 if (error.type === Error.Type.STREAM_ERROR) | ||||
| @@ -185,7 +186,7 @@ angular.module('client').factory('ManagedFileUpload', ['$rootScope', '$injector' | ||||
|                         ManagedFileTransferState.StreamState.ERROR, | ||||
|                         Guacamole.Status.Code.INTERNAL_ERROR); | ||||
|  | ||||
|             }); | ||||
|             })); | ||||
|  | ||||
|             // Ignore all further acks | ||||
|             stream.onack = null; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user