|
26 | 26 |
|
27 | 27 | import com.jcraft.jsch.JSchException;
|
28 | 28 |
|
| 29 | +import jssc.SerialPortException; |
29 | 30 | import processing.app.debug.*;
|
30 | 31 | import processing.app.forms.PasswordAuthorizationDialog;
|
31 | 32 | import processing.app.helpers.OSUtils;
|
@@ -2572,6 +2573,12 @@ public void handleSerial() {
|
2572 | 2573 | statusError(_("Unable to connect: is the sketch using the bridge?"));
|
2573 | 2574 | } catch (JSchException e) {
|
2574 | 2575 | statusError(_("Unable to connect: wrong password?"));
|
| 2576 | + } catch (SerialException e) { |
| 2577 | + String errorMessage = e.getMessage(); |
| 2578 | + if (e.getCause() != null && e.getCause() instanceof SerialPortException) { |
| 2579 | + errorMessage += " (" + ((SerialPortException) e.getCause()).getExceptionType() + ")"; |
| 2580 | + } |
| 2581 | + statusError(errorMessage); |
2575 | 2582 | } catch (Exception e) {
|
2576 | 2583 | statusError(e);
|
2577 | 2584 | } finally {
|
|
0 commit comments