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

Yuya Nishihara yuya at tcha.org
Tue Jul 12 10:40:54 EDT 2016

On Tue, 12 Jul 2016 14:02:27 +0000, Kostia Balytskyi wrote:
> 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”.

These two are RepoLookupError.

> I also think that this
> might be useful beyond unshelve usecase.

Yeah, I agree with that.

More information about the Mercurial-devel mailing list