Improved error message when unable to connect to the board via SSH

This commit is contained in:
Federico Fissore 2013-10-16 17:04:07 +02:00
parent 027f7c7403
commit 54253ee5c3
1 changed files with 4 additions and 0 deletions

View File

@ -36,6 +36,7 @@ import com.jcraft.jsch.JSch;
import com.jcraft.jsch.JSchException;
import com.jcraft.jsch.Session;
import processing.app.Base;
import processing.app.I18n;
import processing.app.Preferences;
import processing.app.debug.RunnerException;
import processing.app.debug.TargetPlatform;
@ -95,6 +96,9 @@ public class SSHUploader extends Uploader {
if ("Auth cancel".equals(message) || "Auth fail".equals(message)) {
return false;
}
if (e.getMessage().contains("Connection refused")) {
throw new RunnerException(I18n.format("Unable to connect to {0}", port.getAddress()));
}
throw new RunnerException(e);
} catch (Exception e) {
throw new RunnerException(e);