Best Practices in Production Level Exception Handling In Java Applications
What is happening in exceptional handling at production level due to the presently prevalent coding style? Ideally, code sent to production servers as the final build of the version should be totally bug free. That is not possible in real-world applications. Also, exceptions do not necessarily occur only due to bugs. A temporary system failure, an uncaught null pointer exception, and other such cases can also lead to exceptions. In a typical DevOps setting, we have come to love our logs. Where exceptions should be well, exceptions that occur only in the most ‘lost cause’ scenarios that disrupt the normal functioning of the Java application. However, because of our love for the written record, we write logs for even the most trivial exceptions. This leads to a lot of noise in the operational logs, which can often bury the really serious exceptions as a mere statistical figure. Unless the exception occurs a significant number of times in a short time window, say a 1000 users not able to checkout a cart