File tree 1 file changed +7
-0
lines changed
1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 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 {
You can’t perform that action at this time.
0 commit comments