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

@@ -47,6 +47,7 @@ angular.module('settings').directive('guacSettingsSessions', [function guacSetti
var connectionGroupService = $injector.get('connectionGroupService');
var dataSourceService = $injector.get('dataSourceService');
var guacNotification = $injector.get('guacNotification');
var requestService = $injector.get('requestService');
/**
* The identifiers of all data sources accessible by the current
@@ -219,7 +220,7 @@ angular.module('settings').directive('guacSettingsSessions', [function guacSetti
// Attempt to produce wrapped list of active connections
wrapAllActiveConnections();
});
}, requestService.WARN);
// Query active sessions
dataSourceService.apply(
@@ -234,7 +235,7 @@ angular.module('settings').directive('guacSettingsSessions', [function guacSetti
// Attempt to produce wrapped list of active connections
wrapAllActiveConnections();
});
}, requestService.WARN);
// Get session date format
$translate('SETTINGS_SESSIONS.FORMAT_STARTDATE').then(function sessionDateFormatReceived(retrievedSessionDateFormat) {
@@ -245,7 +246,7 @@ angular.module('settings').directive('guacSettingsSessions', [function guacSetti
// Attempt to produce wrapped list of active connections
wrapAllActiveConnections();
});
}, angular.noop);
/**
* Returns whether critical data has completed being loaded.
@@ -258,18 +259,6 @@ angular.module('settings').directive('guacSettingsSessions', [function guacSetti
return $scope.wrappers !== null;
};
/**
* An action to be provided along with the object sent to
* showStatus which closes the currently-shown status dialog.
*/
var ACKNOWLEDGE_ACTION = {
name : "SETTINGS_SESSIONS.ACTION_ACKNOWLEDGE",
// Handle action
callback : function acknowledgeCallback() {
guacNotification.showStatus(false);
}
};
/**
* An action to be provided along with the object sent to
* showStatus which closes the currently-shown status dialog.
@@ -327,17 +316,7 @@ angular.module('settings').directive('guacSettingsSessions', [function guacSetti
// Clear selection
allSelectedWrappers = {};
},
// Notify of any errors
function activeConnectionDeletionFailed(error) {
guacNotification.showStatus({
'className' : 'error',
'title' : 'SETTINGS_SESSIONS.DIALOG_HEADER_ERROR',
'text' : error.translatableMessage,
'actions' : [ ACKNOWLEDGE_ACTION ]
});
});
}, requestService.SHOW_NOTIFICATION);
};