The disadvantage is that if you try to catch the exception located at the bottom of the inheritance tree, you will understand all the exceptions derived from this, and some of them may indicate things that are very different from what is expected.
Worse, a developer who has used many functions that can throw exceptions and does not know what some of them mean can simply catch the base class, the exception, and simply return a non-specific instance of Exception when errors occur, which makes it difficult to debug the code and possibly leads the entire program crashes only due to an easily fixed exception, which should not cause any problems.
theo2003
source share