Catch only superclass of exceptions that might be thrown by reflection.