You can combine the `KeyError` and `ValueError` if they have the same error message: `except (KeyError, ValueError):`