[PATCH RFC] scmutil: add a simple key-value file helper

Kevin Bullock kbullock+mercurial at ringworld.org
Mon Dec 5 18:43:52 EST 2016

> On Dec 5, 2016, at 17:42, Augie Fackler <raf at durin42.com> wrote:
>> On Dec 5, 2016, at 18:41, Kevin Bullock <kbullock+mercurial at ringworld.org> wrote:
>>> On Dec 5, 2016, at 16:51, Jun Wu <quark at fb.com> wrote:
>>> Excerpts from Augie Fackler's message of 2016-12-05 17:07:47 -0500:
>>>>> On Dec 5, 2016, at 16:54, Jun Wu <quark at fb.com> wrote:
>>>>>> +                e = _("Invalid value in a simple key-value file")
>>>>>> +                raise self.InvalidValueInFileException(e)
>>>>> These sound like a programmer error. Maybe just raise RuntimeError.
>>>> I'm not comfortable with that, FYI. RuntimeError IMO should be reserved for errors in the Python runtime itself, not run-time errors caused by programmer error.
>>> From what I have learn from the code base. We use RuntimeError for
>>> programmer errors. Seems to be the most "popular" solution.
>> For the cases Jun points out where we don't have a specific subclass, perhaps we should change them to raise a more generic StandardError?

Sorry, I should have said "Exception" instead of "StandardError" here.

> Or just define one and start the process of ripping off the band-aid, yeah.

Or that, yes.

pacem in terris / мир / शान्ति / ‎‫سَلاَم‬ / 平和
Kevin R. Bullock

More information about the Mercurial-devel mailing list