[PATCH 1 of 5] repair: use ProgrammingError

Ryan McElroy rm at fb.com
Thu Mar 30 04:10:33 EDT 2017


On 3/29/17 4:56 PM, Jun Wu wrote:
> Excerpts from Pierre-Yves David's message of 2017-03-29 13:24:39 +0200:
>> On 03/28/2017 08:59 PM, Ryan McElroy wrote:
>>> On 3/27/17 2:11 PM, Augie Fackler wrote:
>>>> On Mon, Mar 27, 2017 at 09:18:55AM +0200, Pierre-Yves David wrote:
>>>>> Sure, that seems like a good idea. Can you see to it ?
>>>> It's a good idea, but I feel like the name "ProgrammingError" alone
>>>> provides some clue as to what's going on, and the migration is good.
>>>>
>>>> Queued, I wouldn't mind a followup to make the hint generic to all
>>>> ProgrammingError instances, but I'm not willing to block on it either.
>>> FWIW, I agree that losing the hint is sad. How confident are we that
>>> core won't have these errors? Can we blame all ProgrammingError
>>> exceptions on extensions?
>> The general idea about pointing at extensions here is that such bug in
>> Mercurial should be caught by the Mercurial test suite (or local
>> development process) so user should not be exposed to it (in theory). On
>> the other hand, existing extensions code might use API wrong in a way
>> that did not raised the error in previous version. So if the user get
>> exposed to that error, it it probably because of an extension.
> I think the question was about *all* ProgrammingErrors, not about a
> particular one. I'm not sure if you have answered that. But maybe my English
> reading is just bad.
>
> FWIW, I think you can answer the question by either:
>
>    Yes, all ProgrammingErrors are extensions' fault.
>
> or,
>
>    No, some ProgrammingErrors are unrelated to extensions.
>
> which is just 60 bytes, more cleaner, 5x shorter, and save time for us all.

Not sure how this is intended, Jun, but this statement come across text 
pretty harshly. Just be careful with your wording and your statements 
please.

I think Pierre-Yves' statement adds important subtlety, which is that we 
expect all ProgrammingErrors in the wild to be caused by extensions. If 
a core developer sees one, we quickly fix it and add a test. I think we 
can use that subtlety in a hint for any programming error. I'll think 
about some possible hints to add here.

Remember we're all on the same team here.

Cheers,

~Ryan


More information about the Mercurial-devel mailing list