Menu

#74 JPacket.toString() exceptions consume all output in progress

Version 1.3
closed-fixed
API Issue (77)
5
2010-09-15
2010-09-15
No

If an exception occurs, typically due to formatting errors, any data in the formatter output buffer is lost when any exception is generated during formating. The correct handling of an exception within a formatter, is to capture all exceptions in JPacket.toString() method, generate a new exception, attach any and all output in the output buffer and add the original exception as "cause" parameter. This way exceptions can be caught outside the JPacket.toString() method and any output upto that particular point can be accessed.

This is critical for debugging purposes as the clues to why and where the exception was generated are typically contained in the partial output.

Discussion

  • Sly Technologies

    The issue has been fixed and will be released in the next major or maintenance release. The bug was found and confirmed. Appropriate jUnit test cases have been created to verify that this issue is resolved and will not be broken again by future changes.

     
  • Sly Technologies

    • status: open --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB