Better error message when opening serial monitor on a busy serial device. Closes #2632

This commit is contained in:
Federico Fissore 2015-02-12 10:20:27 +01:00
parent 7211eb0156
commit e385f67fce
1 changed files with 7 additions and 0 deletions

View File

@ -26,6 +26,7 @@ import cc.arduino.packages.MonitorFactory;
import com.jcraft.jsch.JSchException;
import jssc.SerialPortException;
import processing.app.debug.*;
import processing.app.forms.PasswordAuthorizationDialog;
import processing.app.helpers.OSUtils;
@ -2572,6 +2573,12 @@ public class Editor extends JFrame implements RunnerListener {
statusError(_("Unable to connect: is the sketch using the bridge?"));
} catch (JSchException e) {
statusError(_("Unable to connect: wrong password?"));
} catch (SerialException e) {
String errorMessage = e.getMessage();
if (e.getCause() != null && e.getCause() instanceof SerialPortException) {
errorMessage += " (" + ((SerialPortException) e.getCause()).getExceptionType() + ")";
}
statusError(errorMessage);
} catch (Exception e) {
statusError(e);
} finally {