Little can be said about this.
First, it is recommended to catch exceptions by reference instead of value. This prevents slicing the exception object if it is received. This does not apply to exceptions, but is a common characteristic of inheritance.
A description of this phenomenon is discussed here.
Also, as pointed out in another answer, if you insist on doing so, you need to reorder the catches, since the derived class satisfies the catch base block. There is another way to do this, although it explicitly uses this property: just the base class will catch everything. You can use this if there is no particular feature of a derived exception that needs to be handled separately.
source share