diff options
author | Otavio Pontes | 2012-06-13 18:55:49 +0000 |
---|---|---|
committer | Otavio Pontes | 2012-06-13 20:16:17 +0000 |
commit | ec104952ec06d23050a38febe55db1f59aa0b972 (patch) | |
tree | f10c464aa6c060ab7e948b67331f074194faa71d | |
parent | a1e209c2368a4bc154e31d91943a8b8c658034ca (diff) | |
download | org.eclipse.linuxtools-ec104952ec06d23050a38febe55db1f59aa0b972.tar.gz org.eclipse.linuxtools-ec104952ec06d23050a38febe55db1f59aa0b972.tar.xz org.eclipse.linuxtools-ec104952ec06d23050a38febe55db1f59aa0b972.zip |
ssh.proxy: Dealing with connection errors in SSHCommandLauncher
3 files changed, 6 insertions, 4 deletions
diff --git a/profiling/org.eclipse.linuxtools.ssh.proxy/src/org/eclipse/linuxtools/internal/ssh/proxy/Messages.java b/profiling/org.eclipse.linuxtools.ssh.proxy/src/org/eclipse/linuxtools/internal/ssh/proxy/Messages.java index 3f752b6b8c..73a51fd4b3 100644 --- a/profiling/org.eclipse.linuxtools.ssh.proxy/src/org/eclipse/linuxtools/internal/ssh/proxy/Messages.java +++ b/profiling/org.eclipse.linuxtools.ssh.proxy/src/org/eclipse/linuxtools/internal/ssh/proxy/Messages.java @@ -39,6 +39,7 @@ public class Messages extends NLS { public static String SSHBase_CreateSessionFailed; public static String SSHBase_CreateSessionCancelled; public static String SSHPasswordDialog_Password; + public static String SSHCommandLauncher_execution_problem; static { // initialize resource bundle diff --git a/profiling/org.eclipse.linuxtools.ssh.proxy/src/org/eclipse/linuxtools/internal/ssh/proxy/SSHCommandLauncher.java b/profiling/org.eclipse.linuxtools.ssh.proxy/src/org/eclipse/linuxtools/internal/ssh/proxy/SSHCommandLauncher.java index cc890b2c96..4852ebd79d 100644 --- a/profiling/org.eclipse.linuxtools.ssh.proxy/src/org/eclipse/linuxtools/internal/ssh/proxy/SSHCommandLauncher.java +++ b/profiling/org.eclipse.linuxtools.ssh.proxy/src/org/eclipse/linuxtools/internal/ssh/proxy/SSHCommandLauncher.java @@ -16,12 +16,14 @@ import java.net.URI; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.linuxtools.profiling.launch.IRemoteCommandLauncher; import org.eclipse.linuxtools.ssh.proxy.Activator; import com.jcraft.jsch.ChannelExec; +import com.jcraft.jsch.JSchException; /** * @noextend This class is not intended to be subclassed by clients. @@ -78,11 +80,9 @@ public class SSHCommandLauncher extends SSHBase implements IRemoteCommandLaunche channel.connect(); fProcess = new SSHProcess(channel); return fProcess; - } catch (Exception e) { - errorMessage = e.getMessage(); - e.printStackTrace(); + } catch (JSchException e) { + throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.SSHCommandLauncher_execution_problem + e.getMessage())); } - return null; } @Override diff --git a/profiling/org.eclipse.linuxtools.ssh.proxy/src/org/eclipse/linuxtools/internal/ssh/proxy/messages.properties b/profiling/org.eclipse.linuxtools.ssh.proxy/src/org/eclipse/linuxtools/internal/ssh/proxy/messages.properties index f49ba618c8..1f5a26ec03 100644 --- a/profiling/org.eclipse.linuxtools.ssh.proxy/src/org/eclipse/linuxtools/internal/ssh/proxy/messages.properties +++ b/profiling/org.eclipse.linuxtools.ssh.proxy/src/org/eclipse/linuxtools/internal/ssh/proxy/messages.properties @@ -30,6 +30,7 @@ SSHFileStore_putInfoMonitor=Updating attributes SSHFileStore_rmFailed=SSH delete failed: SSHFileStore_rmMonitor=Removing file SSHCommandLauncher_malformed_env_var_string=Malformed environment variable string: +SSHCommandLauncher_execution_problem=Execution problem: SSHBase_CreateSessionFailed=Failed to connect to remote host: SSHBase_CreateSessionCancelled=Connection to remote host was cancelled SSHPasswordDialog_Password=Password: |