Better use `KeyError` here? Broadly catching `Exception` is a code smell in general, since it could hide bugs (e.g. you make a typo and cause an unintended `AttributeError`.