[darcs-devel] [patch1246] issue822: Improve error message with generalized IO type

Ernesto Rodriguez neto at netowork.me
Fri Jan 9 19:13:24 UTC 2015


Thank you for the feedback.

> darcs failed:  Not a repository:
> http://hub.darcs.net/gh/darcs-screened_111
<http://hub.darcs.net/gh/darcs-screened_111> (CouldNotResolveHost)

Indeed, thanks for pointing that out. It should say "(HTTP response code
said error 404)" as it used to be. I will look into that.

> One question though: Is the generalization to MonadIO etc really
necessary to achive the goal i.e. capture the stderr output?

No it is not necessary. The issue can be resolved w/o doing this. Two
solutions are possible:

1) Throw an exception and not make visible in the type and catch the
exception in the "tryIdentifyRepoFormat" funtion as currently done. The
disatvantage of this approach is having an effect (ie. the exeption) not
visible in the type.

2) Changing the function "copyFileOrUrl", "copySsh" and some other
functions (the ones that now have the MonadIO type) to return an Either
type. The problem here is that the functions are used in many other places
in darcs so it would require significant refactoring. This would take some
more time.

I can easily  adjust my patch and implement #1, but I don't see any
shortcommings in having the exception visible in the type.

Cheers,

Ernesto


On Fri, Jan 9, 2015 at 7:53 PM, Ben Franksen <bugs at darcs.net> wrote:

>
> Ben Franksen <benjamin.franksen at helmholtz-berlin.de> added the comment:
>
> I tested this with a non-existing remote repo but an existing host and get
>
> ben at sarun[1]: .../darcs/screened > darcs pull
> http://hub.darcs.net/gh/darcs-screened_111
>
> darcs failed:  Not a repository:
> http://hub.darcs.net/gh/darcs-screened_111 (CouldNotResolveHost)
>
> This is wrong, the host exists but not the path.
>
> __________________________________
> Darcs bug tracker <bugs at darcs.net>
> <http://bugs.darcs.net/patch1246>
> __________________________________
>



-- 
Ernesto Rodriguez

Masters Student
Computer Science
Utrecht University

www.netowork.me
github.com/netogallo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osuosl.org/pipermail/darcs-devel/attachments/20150109/8b8861f2/attachment.html>


More information about the darcs-devel mailing list