0 Replies Latest reply on Jan 16, 2011 1:58 AM by Jason Porter

    Stacktrace filtering or modifying in Seam Catch

    Jason Porter Master

      For those who have been watching the Catch module, you may have seen SEAMCATCH-4.  I'm considering moving this out to the beta or possibly later depending on how much time I am able to put into it and how quickly I need a beta release for the bundled Seam 3 beta due out for JBoss World.  I'd like to hear people's input in this.

      I'd also like any feedback on the proposed API from Dan Allen posted in the comments of this issue.  The purpose of this is to create a framework for modifying stack traces to be output to log (or anywhere else you might like to see a stack trace.  You will see some examples Dan has cooked up with this API.  It would allow you to fold a stack trace, remove elements from a stack trace, change the exception(s) declared in the trace, etc.  I believe it's a pretty solid API, and I'd like to implement it, but I'd also like to get some feedback from the community about it.

      To go along with this, I will create an object that will take an exception, generate the stack trace, apply any filtering and also inverse the printed stack trace from what Java currently gives you, I believe it's not very helpful anyway. Currently, in order to actually see what the exception is you have look down at the bottom of the trace.  I'm really not sure what they were thinking here.  I believe if the root exception is listed first, then follows up the stack (instead of drilling down into the stack) it is much more helpful to developers as you can more easily follow the course of events to the exception, and you don't have to look at the rest of the stack trace save the top if you don't want to.  This would all be done as a basic Java SE portion of the Catch module and would not require CDI at all. The reason for this would be if you want to use it outside of a CDI environment, as I really see some potential for it's use outside of CDI.

      The basic idea for this would be a builder idea, possibly with a fluent-ish API which returns a formatted string OR it can take an output stream and print the trace to that stream.  Any thoughts along those lines?