Jump to content
Excelsior Forums
Sign in to follow this  
mercenarius

No Stack Trace and Error Diagnosis

Recommended Posts

Well, I noticed that compiling with no stack trace seems to greatly speed up my application on relatively slow hardware. That is good news by itself. The performance is quite good now.

However, that seems to leave no way for the application to meaningful report an unexpected error like the dreaded NullPointerException.

My application cannot realistically recover from this kind of error, and I don't want it to anyway. But what I need is to find some way to allow the end user to get some meaningful feedback to me if this ever happens.

I don't care very much about a stack trace per se anyway. But the line number or other information on the source of the error is crucial for creating a meaningful crash report on the fly. Otherwise users can only report that the application crashed on such and such a screen and that might be worse than useless.

Of course, I can simply plan on being perfect.  ;) After all, the only way that this can happen is through an error on my part.

Is there a known way around this problem? Expected errors, like exceptions during I/O operations are a completely different matter, of course.

Share this post


Link to post
Share on other sites

You may compile your application with stack trace disabled.

When stack trace is necessary, run the executable with the following script

---------- run.bat

SET JETVMPROP=-Djet.stack.trace

YourApp.exe

----------

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×