Use testing-specific exception hierarchy for polymorphism tests