Add type hint to exception variable in the class selector case

Fixes #37