whitelist.py: Specify exception types for more exceptions.