I am creating a java application in which there is a possibility that exceptions might be thrown. I am handling these exceptions in a try-catch block and printing appropriate messages so that the business users don't have to see the ugly stack trace in case of a failure.
But now when I debug, I would like to invoke the JAR file in such a way that it will print the stack traces for me, so that I can know where exactly the problem lies.
Can someone enlighten me on how this can be achieved?
解决方案
Why not use Logging levels.?
DEBUG for your technical errors
and INFO or ERROR with the business codes that your users understand.