Skip to content

Commit

Permalink
Throws correct exception now
Browse files Browse the repository at this point in the history
  • Loading branch information
retrodaredevil committed May 14, 2020
1 parent 37da71e commit ee14765
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public void sendMessage(OutputStream outputStream, int address, ModbusMessage me
try {
outputStream.write(bytes);
} catch (IOException e) {
throw new ModbusRuntimeException(e);
throw new ModbusRuntimeException("Got exception while writing", e);
}
}
public static char[] toAscii(int address, ModbusMessage message){
Expand Down Expand Up @@ -115,7 +115,7 @@ public ModbusMessage readMessage(int expectedAddress, InputStream inputStream) {
try {
bytes = readLine(inputStream);
} catch (IOException e) {
throw new ModbusRuntimeException(e);
throw new ModbusRuntimeException("Got exception while reading", e);
}
return fromAscii(expectedAddress, bytes);
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/me/retrodaredevil/io/modbus/RTUDataEncoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void sendMessage(OutputStream outputStream, int address, ModbusMessage me
try {
outputStream.write(bytes);
} catch (IOException e) {
throw new ModbusRuntimeException(e);
throw new ModbusRuntimeException("Got exception while writing", e);
}
}
public static byte[] toBytes(int address, ModbusMessage message){
Expand All @@ -56,7 +56,7 @@ public ModbusMessage readMessage(int expectedAddress, InputStream inputStream) {
try {
bytes = readBytes(inputStream);
} catch(IOException e){
throw new RuntimeException(e);
throw new ModbusRuntimeException("Got exception while reading", e);
}
return fromBytes(expectedAddress, bytes);
}
Expand Down

0 comments on commit ee14765

Please sign in to comment.