Bug 209291 - [terminal][api] ITerminalViewControl.connectTerminal() should throw exceptions on error conditions
Summary: [terminal][api] ITerminalViewControl.connectTerminal() should throw exception...
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: terminal (show other bugs)
Version: Next   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords: api, helpwanted
Depends on:
Blocks:
 
Reported: 2007-11-08 21:28 EST by Bryan Hunt CLA
Modified: 2020-09-04 15:11 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bryan Hunt CLA 2007-11-08 21:28:59 EST
Build ID: 3.3.1.1

Steps To Reproduce:
1. Create terminal settings that contain a bad user id
2. Connect the terminal


More information:
A login dialog will be displayed that doesn't allow you to change the user id.

The terminal should pass control back to the client code if it receives bad credentials.  I'm using my own login dialog with specialized security code to handle credentials.  This code needs control if the login fails.

Here is some example code I'm using to create my connection:

	public void connect(Credential credential) throws SecurityServiceException
	{
		terminalSettings.put("User", credential.getId());
		terminalSettings.put("Password", credential.getPassword());

		connector.load(terminalSettings);
		terminal.connectTerminal();
		// TODO: check for invalid login and throw exception
	}
Comment 1 Martin Oberhuber CLA 2007-11-15 11:18:36 EST
I'm afraid I don't quite understand what you want. Can you explain more, or come up with a patch?
Comment 2 Martin Oberhuber CLA 2008-02-05 12:11:34 EST
Changed subject - previous value was:
Terminal does not support invalid credentials gracefully

The point is that when using the Terminal Widget programmatically, ITerminalViewControl.connectTerminal() and related methods called from it (e.g. in the TerminalConnector) should throw excpetions rather than showing UI dialogs because the driving connect code could have methods for reacting to those exceptions that the Terminal Widget does not know.

There should also be a well-known hierarchy of exceptions for typical cases:
  * Socket Timeout, Network problems
  * Invalid Credentials
  * Initialization Error with embedded message from 
    ITerminalConnectorInfo.getInitializationErrorMessage()

Related to this, API Docs of ITerminalConnector.connect() should specify that the connect() code should not display dialogs on error conditions but also throw exceptions (whereas if the connector requires additional user input, it may be allowed to show a dialog for asking this input).
Comment 3 Jonah Graham CLA 2020-05-01 10:11:06 EDT
The Terminal component of the Eclipse Ecosystem has a new home. The Terminal is now part of the Eclipse CDT project[1].

This change means a new Git repo[2], P2 site[3] and Bugzilla component. The terminal will continue to be delivered as part of the quarterly Simultaneous Release of Eclipse as well.

The marketplace entry[4] had not been updated in a few years. It will once again install the latest release of the terminal on the latest release of the whole IDE (currently 2020-03).

If this bug is no longer relevant, please feel free to comment or close the bug. If you can confirm if this issues still occurs in the latest release please do let me know in a comment.

[1] https://wiki.eclipse.org/CDT/User/NewIn911
[2] https://git.eclipse.org/c/cdt/org.eclipse.cdt.git (in the terminal directory)
[3] current release is 9.11 - P2 site https://download.eclipse.org/tools/cdt/releases/9.11/
[4] https://marketplace.eclipse.org/content/tm-terminal

(This comment was added to all open terminal bugs along with changing the Product/component pair to CDT/terminal.)