Community
Participate
Working Groups
+++ This bug was initially created as a clone of Bug #182221 +++ Some methods in IRemoteFileSubSystem throw exceptions in case an error occurs (e.g. listFilesAndFolders(), connect() which is inherited from ISubSystem, ...) while others try to handle exceptions themselves by showing a SystemMessageDialog (e.g. download()). Showing a dialog in the Subsystem implementation is problematic, because 1. It makes mass file copies impossible because they would handle exception for every file rather than once in a MultiStatus 2. It requires UI but Subsystem code should be non-UI 3. Extenders cannot deal with exceptions in a way they would prefer - this is particularly problematic for EFS 4. It makes the code inconsistent and blown up, e.g. bug 182221 As a general guideline, non-UI-code should throw exceptions, and UI code should handle them. Subsystems should be considered non-UI code. Work items: * Remove SystemMessageDialog from all IRemoteFileSubsystem implementations; similar for Processes if needed * Change Method signature of IRemoteFileSubsystem to throw SystemMessageException wherever needed * Adapt all callers to deal with the SystemMessageException themselves.
I'll attempt fixing this for M7.
Created attachment 66707 [details] Refactoring script with method signature changes in IRemoteFileSubSystem
Work completed, checkin comment: [183824][api] Forward SystemMessageException from IRemoteFileSubsystem rather than handling it Attached refactoring script has a record of the method signatures changed, though applying this script to a local workspace will only change signatures in subclasses of IRemoteFileSubSystem so it will not be beneficial for many extenders. The following methods in IRemoteFileSubSystem were changed to throw SystemMessageException instead of other exceptions they threw before; implementation in FileServiceSubsystem was changed to forward exceptions rather than showing a dialog. Client code was updated to show the appropriate message dialogs. It might be that I missed some occurrences, so some exceptions during remote file operations might now be swallowed silently rather than showing a dialog. It's expected that these will be found during testing later, but the API is certainly improved now. Changed methods in IRemoteFileSubSystem: copy() copyBatch() createFile() createFolder() createFolders() delete() deleteBatch() download() move() rename() setLastModified() setReadOnly() upload()
[target cleanup] 2.0 M7 was the original target milestone for this bug