Concept

Why should the most specific exception types be caught before general ones?

ComputerScienceOne / Throwing Exceptions

"Note that the last catch block was written to catch a generic Exception. This last block will essentially catch any other type of exception. Much like an if-else-if statement, the first type of exception that is caught is the block that will be executed and they are all mutually exclusive. Thus, a “catch all” block like this should always be the last catch block. The most specific types of exceptions should be caught first and the most general types should be caught last."

Related Ideas

Why should the most specific exception types be caught before general ones? | ComputerScienceOne | Bifalgorithm | Bifalgorithm