KeyError is usually reserved for dictionaries, I recommend ValueError