[PATCH 2 of 2 V3] error: make hintable exceptions reject unknown keyword arguments (API)

Kostia Balytskyi ikostia at fb.com
Tue Jul 12 10:02:27 EDT 2016


On 7/12/16, 2:11 PM, "Yuya Nishihara" <youjah at gmail.com on behalf of yuya at tcha.org> wrote:

>On Tue, 12 Jul 2016 09:39:25 +0000, Kostia Balytskyi wrote:
>> These 2 patches look good to me. Once they are accepted I will introduce
>> MercurialException and replace Exception -> MercurialException here. My goal
>> is not related to dispatch.runcommand(), but more to unshelve’s
>> shelvedstate.load exception-catching, but I think it’s generally a good
>> thing to do.
>
>I don't get the point why you prefer catching everything except
>MercurialException over catching exceptions that can be raised by
>int() and nodemod.bin(). IMHO, it's bad practice to suppress unknown
>exceptions.

I do want to catch exceptions that can be raised by int() and nodemod.bin(), but I want
to also be able to catch things like “unknown node” or “filtered node”. I also think that this
might be useful beyond unshelve usecase.



More information about the Mercurial-devel mailing list