mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-18 07:52:14 +01:00
Providing a more meaningful error message when attempting to open serial monitor and linux user misses permission on device. Fixes #2100
This commit is contained in:
parent
bc05c40aa0
commit
c4e1458b1d
@ -123,7 +123,10 @@ public class Serial implements SerialPortEventListener {
|
||||
port.openPort();
|
||||
port.setParams(rate, databits, stopbits, parity, true, true);
|
||||
port.addEventListener(this);
|
||||
} catch (Exception e) {
|
||||
} catch (SerialPortException e) {
|
||||
if (e.getPortName().startsWith("/dev") && SerialPortException.TYPE_PERMISSION_DENIED.equals(e.getExceptionType())) {
|
||||
throw new SerialException(I18n.format(_("Error opening serial port ''{0}''. Try consulting the documentation at http://playground.arduino.cc/Linux/All#Permission"), iname));
|
||||
}
|
||||
throw new SerialException(I18n.format(_("Error opening serial port ''{0}''."), iname), e);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user