views:

142

answers:

2

Hello! My java app is dumping stacktrace to a log file. However, the solution center wants an "easier" way to understand the generated stacktrace.

Other than training them in java, is there a stacktrace editor or gui that could make their life easier?

Thanks so much in advance!

A: 

Are you able to modify your code to generate more clear, user readable errors?

Alex B
Yes, for business errors it's fine. But for bugs, or the database dying, etc, I'm just thorwing the exception (Hoping the stacktrace helps me determine the bug...)
Sergio Vera
In that case, I usually log the stack trace to a log file for me to review and log "Unexpected Software Exception" to the user. The user should get as specific a message as they can, possibly "Unexpected Database Exception" or "Unexpected Exception while storing customer data", etc.
Alex B
+1  A: 

You may consider having two logfiles. One containing debug information for you, and another containing information for the solution center. They may be satisfied just with the "RuntimeException: The Sky Is Falling" line to allow them to determine that this is something unexpected that should go to the developer.

You may also want to have an outer try-catch construction which catches all Throwables and try to provide information for the solution center. E.g. for an SQLException, "This is an error with the database, ensure it works properly, restart the applciation and raise a ticket with the developers."

In other words, provide as much information about the situation as you can up front, and in a clear language. This might be a good team effort for a day or two.

Thorbjørn Ravn Andersen
Of course adding try catch everywhere is ugly... I will use Spring to log/retrhow any exception.I will be using info form here...http://forum.springsource.org/showthread.php?t=12083http://static.springsource.org/spring/docs/1.2.9/reference/aop.html
Sergio Vera
You generally have a last-chance try-catch construction (e.g. in main() in an application) which catches everything so you can log it. I just suggest that you do some work with instanceof so you can provide some additional information.
Thorbjørn Ravn Andersen
I craeated a class like public class ExceptionHandler implements ThrowsAdvice{ public void afterThrowing(Exception ex) { //instance of and additional logic goes here and defined a point cut in Spring <aop:config> <aop:advisor id="exceptionHandlerAspect" pointcut="execution(* *..yadda..*.*(..))" advice-ref="exceptionHandler" /> </aop:config> <bean id="exceptionHandler" class="com.yadda.ExceptionHandler"/> ...in case someone is interested. Thank you all for your comments!
Sergio Vera