Is this a ruse and does the demand really indicate that is strict?
No, I think that in certain situations it can be excluded by uncontrolled exceptions ( RuntimeExceptions ).
For example, if the user enters a number, I think it's fine, what needs to be done
double i; try { i = Double.parseDouble(userInput); } catch (NumberFormatException e) { addValidationError("Entered number is not valid: " + userInput); }
If the exception is unexpected and corresponds to an error in the code, do not bother to catch it (or catch it at the highest level, for example, in handleRequest or something else, and, for example, return an error of 500), On the other hand, if you can provide for the generated exception (and it’s problematic to use regular control structures such as if to cover these cases, for example, in the above example NumberFormatException ), catch it and handle it.
As it happens, RuntimeExceptions often correspond to programmer errors and say that "do not catch RuntimeExceptions" can probably be considered as a good approximation of what can be caught and not caught.
When a developer decides whether to RuntimeException Exception or a RuntimeException , he / she will think about whether it is wise to force clients to throw throws or throw an exception. In some cases, the exception may be due to a programming error or a “normal operation” error. In such cases, it is dishonest to force throws / catch clients, and it is more suitable to make it a RuntimeException . In client code, where an exception is actually used to indicate a "normal operation" error, it is still appropriate to catch it.
A related question (but closed mostly based on opinion): stackoverflow.com/questions/24344511/why-is-catching-a-runtimeexception-not-considered-a-good-programming-practice