Error hiding
Exception/error handling is a very common process. In fact, it is one of the most prominent topics when learning a new programming language. Exception handling helps programmers to manage adverse conditions and ensures that the software/application can recover from any expected or unexpected failures. Often, programmers ignore the importance of exception handling, which results in:
- Erroneous screens/messages being visible to end users
- Catastrophic program failures leaving programs/data in an unstable state
- Incorrect/improper error messages being displayed to users
The first step in exception handling is to ensure that all the probable areas should be equipped with an appropriate exception handling logic. As commonly stated "at minimum, all publicly accessible methods should have an appropriate try/catch". It solves the first point mentioned earlier, that is, erroneous screens/messages being visible to end users.
Let's focus on the second and third points now.
In Apex, database transactions...