mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-07 00:05:53 +02:00
Provide a more relevant message when Daytime service isn't available.
This commit is contained in:
parent
4c8908a591
commit
aa05ec3371
1 changed files with 10 additions and 1 deletions
|
@ -16,6 +16,9 @@
|
||||||
|
|
||||||
package org.eclipse.rse.examples.daytime.connectorservice;
|
package org.eclipse.rse.examples.daytime.connectorservice;
|
||||||
|
|
||||||
|
import java.net.ConnectException;
|
||||||
|
import java.text.MessageFormat;
|
||||||
|
|
||||||
import org.eclipse.core.runtime.IProgressMonitor;
|
import org.eclipse.core.runtime.IProgressMonitor;
|
||||||
import org.eclipse.rse.core.subsystems.AbstractConnectorService;
|
import org.eclipse.rse.core.subsystems.AbstractConnectorService;
|
||||||
import org.eclipse.rse.examples.daytime.DaytimeResources;
|
import org.eclipse.rse.examples.daytime.DaytimeResources;
|
||||||
|
@ -48,7 +51,13 @@ public class DaytimeConnectorService extends AbstractConnectorService {
|
||||||
private void internalConnect() throws Exception
|
private void internalConnect() throws Exception
|
||||||
{
|
{
|
||||||
fDaytimeService.setHostName(getHostName());
|
fDaytimeService.setHostName(getHostName());
|
||||||
fDaytimeService.getTimeOfDay();
|
try {
|
||||||
|
fDaytimeService.getTimeOfDay();
|
||||||
|
} catch (ConnectException e) {
|
||||||
|
String template = "Daytime service is not available on {0}.";
|
||||||
|
String message = MessageFormat.format(template, new Object[] {getHostName()});
|
||||||
|
throw new Exception(message);
|
||||||
|
}
|
||||||
//if no exception is thrown, we consider ourselves connected!
|
//if no exception is thrown, we consider ourselves connected!
|
||||||
fIsConnected = true;
|
fIsConnected = true;
|
||||||
//TODO force a refresh of the Viewer in order to show the resource
|
//TODO force a refresh of the Viewer in order to show the resource
|
||||||
|
|
Loading…
Add table
Reference in a new issue