So one of the things we need to clean up in our codebase is places where we catch an exception and throw a new exception but do *not* keep the original exception.

I attempted to grep for this and found that pretty much impossible to do, so instead I hacked up something with ASM to check the code in openejb-core for places where we are constructing something of type Throwable using the single string constructor. I.e. places where we are potentially "eating" exceptions.

  the list:  http://cwiki.apache.org/OPENEJB/hungry-exceptions.html

There are likely several mentioned in that list that are legitimate usages of "new Exception(myString)" Typically that'd be code that checks for a certain state and throws an exception if the condition is not met -- there really is no "original" exception as that *is* the original exception. But pretty much everything else should get fixed.

I'm tempted to create JIRAs for each class so we always have a current list, but I'm hesitant as it could get out of sync with svn really fast. We'd have to work through the list really fast to make that a good idea. What do people think?

Who is interested in helping?  I definitely plan to fix what I can.

-David

Reply via email to