Bug 226301 - [api][breaking] IShellService methods should throw SystemMessageException
Summary: [api][breaking] IShellService methods should throw SystemMessageException
Status: RESOLVED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: 3.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 3.0 M6   Edit
Assignee: Martin Oberhuber CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks: 215059 226374
  Show dependency tree
 
Reported: 2008-04-09 11:07 EDT by Martin Oberhuber CLA
Modified: 2008-04-09 17:41 EDT (History)
11 users (show)

See Also:


Attachments
Patch adding requested throws and fixing Javadoc (41.75 KB, patch)
2008-04-09 17:34 EDT, Martin Oberhuber CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Oberhuber CLA 2008-04-09 11:07:50 EDT
From Bug #226262 comment 1:

   IShellService#launchShell()
   IShellService#runCommand()
   IShellService#getHostEnvironment()

need to contact the remote side, but have no useful means of returning an error status with message to the user, in case anything goes wrong. All they can do for now, is return an IHostShell object that is not active - but that doesn't include an error message.

I propose that all these methods should throw SystemMessageException in order to inform the user when something goes wrong. Currently, we have some ugly exception.printStackTrace() in the Constructor of SshHostShell, for instance; this problem would then go away.

This request is a breaking change since SystemMessageException is a checked exception, and clients who call these methods are currently not prepared to handle it.
Comment 1 Martin Oberhuber CLA 2008-04-09 17:34:53 EDT
Created attachment 95432 [details]
Patch adding requested throws and fixing Javadoc

Attached patch performs the requested API change.

Migration Docs:
---------------
When the compiler warns about unhandled SystemMessageException while using IShellService, add exception handling to properly handle it.

This fix should allow us to properly handle bug 215059.
Comment 2 Martin Oberhuber CLA 2008-04-09 17:41:07 EDT
Patch committed:
[api][breaking] IShellService methods should throw SystemMessageException