Proper Java Exception Handling

Let's talk about sore points. Due to my duties, I have to work with many different services (make edits, conduct code reviews ...); different teams usually write all these services, and whenever it comes to handling errors and forwarding them from the service, sometimes my eyes start watering. Let me try to tell you what code, in my opinion, is not acceptable for error handling and how it should be in my opinion.

In general, initially, the problem is hidden in the flaw in the analytics of the service. Often, there is no requirement in terms of reference on how errors should be thrown. As a rule, this happens for two reasons; the first is the rush to develop a new service, and the second is that the analyst trusts the experience of the developer. In such cases, the analyst simply tells the developer, "Well, give me an example of an error message later, and I will attach it in confluence."

CategoriesUncategorized