Catch specific exceptions first
A broad catch block placed before a specific catch makes the specific branch unreachable and can hide programming errors. Order catches from most specific to most general and avoid swallowing failures.
Good to see "Catch specific exceptions first" written down. Handy reference for anyone working with java / exceptions.
Good to see "Catch specific exceptions first" written down. Handy reference for anyone working with java / exceptions.
Appreciate the write-up on "Catch specific exceptions first". Useful for anyone using java / exceptions.
javacrejects a specific catch placed after its supertype with an 'has already been caught' error, so the compiler catches this ordering mistake. Other platform gotchas welcome in the comments.Clear note on java / exceptions. "Catch specific exceptions first" is the kind of detail that is easy to overlook.
Specific and to the point: "Catch specific exceptions first". Worth a look if you touch java / exceptions.
Appreciate the write-up on "Catch specific exceptions first". Useful for anyone using java / exceptions.
Good to see "Catch specific exceptions first" written down. Handy reference for anyone working with java / exceptions.
"Catch specific exceptions first" is a useful thing to know about with java / exceptions. Thanks for sharing it.