Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 325923

Summary: SystemFetchOperation Cancel message not suitable
Product: [Tools] Target Management Reporter: Noriaki Takatsu <takatsu>
Component: RSEAssignee: David McKnight <dmcknigh>
Status: RESOLVED FIXED QA Contact: Martin Oberhuber <mober.at+eclipse>
Severity: normal    
Priority: P3 CC: dmcknigh, e03616
Version: 3.2   
Target Milestone: 3.3 M3   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 327666, 335687    
Attachments:
Description Flags
patch to now show interrupted exception message
none
patch to not show interrupted exception or operation cancelled exception message none

Description Noriaki Takatsu CLA 2010-09-22 00:22:20 EDT
The following steps can be used to reproduce the message:

The Daemon is configured to use SSL connection.
1. Expand Files
2. Expand My Home
3. Press Cancel button in "Import Host Certificate" window
4. Then you will get the following message 
         RSEG1066U Operation failed with exception '%1'

.log shows the following exception:

java.lang.InterruptedException
	at org.eclipse.rse.connectorservice.dstore.DStoreConnectorService.connectWithDaemon(DStoreConnectorService.java:641)
	at org.eclipse.rse.connectorservice.dstore.DStoreConnectorService.internalConnect(DStoreConnectorService.java:1343)
	at org.eclipse.rse.core.subsystems.AbstractConnectorService.connect(AbstractConnectorService.java:415)
	at org.eclipse.rse.ui.operations.SystemFetchOperation.ensureConnected(SystemFetchOperation.java:303)
	at org.eclipse.rse.ui.operations.SystemFetchOperation.execute(SystemFetchOperation.java:364)
	at org.eclipse.rse.ui.operations.SystemFetchOperation.run(SystemFetchOperation.java:180)
	at org.eclipse.rse.ui.view.AbstractSystemViewAdapter.fetchDeferredChildren(AbstractSystemViewAdapter.java:2290)
	at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:235)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Comment 1 David McKnight CLA 2010-10-13 10:24:13 EDT
The problem is that we're passing in null as the substitution variable.  I've committed a fix for this.
Comment 2 Martin Oberhuber CLA 2010-11-09 06:54:56 EST
Dave, it looks like you left an "e.printStackTrace()" too much in the code:

SystemFetchOperation line 322
Comment 3 Martin Oberhuber CLA 2010-11-09 06:55:47 EST
I removed it
Comment 4 Martin Oberhuber CLA 2011-01-05 17:42:14 EST
CQ:WIND00246662
Dave - I think that even if the substitution var is properly filled, the dialog is not suitable after pressing cancel.

For an SSH connection, when I expand the "My Home" filter to force an implicit connect and then press cancel, I get a dialog saying

  Operation failed with exception 'java.lang.InterruptedException'

Expected behavior is IMO not getting a dialog at all. I just pressed cancel, so of course I want to cancel connecting. The extra dialog showing an internal exception looks unprofessional.

This may actually be related to bug 190750 which requests using OperationCanceledException rather than InterruptedException for cancellation, since the OperationCanceledException is often ignored and doesn't force a dialog into the user's face.
Comment 5 David McKnight CLA 2011-01-06 11:16:09 EST
Created attachment 186183 [details]
patch to now show interrupted exception message

This patch is pretty simple - it just doesn't show the error message when catching an InterruptedException.  Is this preferable?
Comment 6 Martin Oberhuber CLA 2011-01-19 08:18:10 EST
*** Bug 334737 has been marked as a duplicate of this bug. ***
Comment 7 Martin Oberhuber CLA 2011-01-19 08:19:46 EST
You may also want to filter-out OperationCanceledException, such that the dialog doesn't show up when bug 190750 gets eventually implemented.
Comment 8 David McKnight CLA 2011-01-19 09:53:12 EST
Created attachment 187109 [details]
patch to not show interrupted exception or operation cancelled exception message
Comment 9 David McKnight CLA 2011-01-19 09:57:49 EST
I've committed the change to cvs.  

Noriaki, do you require a backport with this fix?
Comment 10 Masao Nishimoto CLA 2011-01-26 21:06:52 EST
Yes, backport to 3.2 maintenance stream is required.