Menu

#51 Exception handling prints stack trace to stdout

v1.2rc1
open
nobody
None
3
2017-10-04
2014-03-14
Daniel Sohl
No

The method ModbusTCPTransport.readResponse() blindly catches all Exceptions and prints the stack trace before throwing a new ModbusIOException. The ModbusIOException should wrap the underlying Exception as its cause. At the very least, Modbus.debug should be consulted before printing anything to standard out.

This isn't the only place where ex.printStackTrace() is called - they should all be visited with this in mind.

Discussion

  • Julie Haugh

    Julie Haugh - 2014-04-13

    Greets,

    I've not had a chance to go through all of j2mod and make the change that you've requested, though I personally find it annoying. I've tried goading Dieter into fixing jamod over the years, without much success. If this issue is keeping you from using jamod, please take a look at j2mod and I'd be more than happy to do the cleanup work you're looking for.

     
  • Marlon Trujillo

    Marlon Trujillo - 2017-10-04
     

Log in to post a comment.