You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
line to be ran and an IOException was thrown. My program caught the IOException and tried to continue normally. However, the next time my program tried to write, since the serial port was closed, m_FD was -1, so the write called checkState and this line ran:
In my opinion, throwing an IllegalStateException (PureJavaIllegalStateException) makes no sense, especially since I'm in the middle of a write and an IOException should really be thrown instead. From the javadoc documentation of write: "IOException - if an I/O error occurs. In particular, an IOException is thrown if the output stream is closed"
I think this should be changed to an IOException to be consistent with other OutputStreams. My guess is that there are probably a few other places where an IOException makes more sense than a PureJavaIllegalArgumentException, but I'd like to hear thoughts on that.
The text was updated successfully, but these errors were encountered:
I was using this library and for some reason my serial port disconnected, (not the fault of this library). That caused this:
purejavacomm/src/purejavacomm/PureJavaSerialPort.java
Line 639 in d3b6903
line to be ran and an IOException was thrown. My program caught the IOException and tried to continue normally. However, the next time my program tried to write, since the serial port was closed,
m_FD
was -1, so the write calledcheckState
and this line ran:purejavacomm/src/purejavacomm/PureJavaSerialPort.java
Line 1293 in d3b6903
In my opinion, throwing an IllegalStateException (PureJavaIllegalStateException) makes no sense, especially since I'm in the middle of a write and an IOException should really be thrown instead. From the javadoc documentation of
write
: "IOException - if an I/O error occurs. In particular, an IOException is thrown if the output stream is closed"I think this should be changed to an IOException to be consistent with other
OutputStream
s. My guess is that there are probably a few other places where an IOException makes more sense than a PureJavaIllegalArgumentException, but I'd like to hear thoughts on that.The text was updated successfully, but these errors were encountered: