Skip to content

Commit

Permalink
Catch ISE (#17854)
Browse files Browse the repository at this point in the history
Signed-off-by: Leo Siepel <[email protected]>
  • Loading branch information
lsiepel authored Dec 7, 2024
1 parent 5d89c9a commit 37d910d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ public enum DSMRErrorStatus {
* Serial port doesn't support the configured settings.
*/
PORT_NOT_COMPATIBLE(true),
/**
* Serial port time out or illegal state.
*/
PORT_PORT_TIMEOUT(false),
/**
* Reading data from the serial port failed.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@ public void open(final DSMRSerialSettings portSettings) {
logger.warn("Possible bug because a new serial port value was set during opening new port.");
errorStatus = DSMRErrorStatus.PORT_INTERNAL_ERROR;
}
} catch (final IllegalStateException ise) {
logger.debug("Failed communicating, probably time out", ise);

errorStatus = DSMRErrorStatus.PORT_PORT_TIMEOUT;
} catch (final IOException ioe) {
logger.debug("Failed to get inputstream for serialPort", ioe);

Expand Down

0 comments on commit 37d910d

Please sign in to comment.