Fix exception hierarchy

This one fixes #2925 is a standard way to represent exceptions in these cases.