[darcs-devel] [patch2161] resolve issue2674 (and a few more)

Ben Franksen ben.franksen at online.de
Tue May 4 20:07:21 UTC 2021


> So the exception will bubble out and users will have to repair their
> repository before they can run this command? I think that's reasonable
> if they have a good way for them to discover that they need to. So maybe
> we still need to catch DoesNotExistError and print out a message before
> rethrowing?

Right. Ideally we would be able to tell which patch failed to apply, but
we don't know that here: this is only known where we define apply. But
at /that/ point we only have an ApplyMonad constraint which does not
allow to catch and throw exceptions (this is a design error). So with
the current design we can only tell the user that *some* patch failed to
apply and suggest darcs repair. I think the right place to add this
message is in runDefault.

> BTW the `mplus` that's still there will still mean that any exception
> from the renameDirectory will be swallowed. We'll only see exceptions
> coming from renameFile:

True. We should use System.Directory.renamePath.

Will send follow-ups.



More information about the darcs-devel mailing list