You are right, this is to explain the KeyError, so I changed it to raise a custom Error.