Skip to content

Commit

Permalink
Do not obfuscate error messages (#16)
Browse files Browse the repository at this point in the history
Signed-off-by: Sami Salonen <ssalonen@gmail.com>
  • Loading branch information
ssalonen authored May 17, 2021
1 parent d42a0b5 commit bbc307b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/java/net/wimpi/modbus/io/ModbusRTUTransport.java
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ private void getResponse(int fn, BytesOutputStream out) throws IOException {
}
} catch (IOException e) {
m_CommPort.disableReceiveThreshold();
throw new IOException("getResponse serial port exception");
throw e;
}
}// getResponse

Expand Down
3 changes: 2 additions & 1 deletion src/main/java/net/wimpi/modbus/io/ModbusTCPTransport.java
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ public ModbusRequest readRequest() throws ModbusIOException {
throw new ModbusIOException(true);
} catch (Exception ex) {
// ex.printStackTrace();
throw new ModbusIOException("I/O exception - failed to read.");
throw new ModbusIOException(String.format("I/O exception - failed to read: %s %s",
ex.getClass().getSimpleName(), ex.getMessage()));
}
}// readRequest

Expand Down

0 comments on commit bbc307b

Please sign in to comment.