[darcs-devel] Better error reporting for exec_ and friends
Eric Y. Kow
eric.kow at gmail.com
Fri Sep 29 00:55:32 PDT 2006
On Fri, Sep 29, 2006 at 00:39:21 -0400, Magnus Jonsson wrote:
> >1) It adds some new exit codes for internal usage, paraphrasing the
> >comments,
> > -1 for fork() failure
> > -2 for pipe(),
> > -3 execvp_no_vtalarm()
> > Dut does this mean we're counting on the programs themselves never
> > exiting with these codes?
>
> exec_extern returns process id of the newly launched child process, or one
> of those error codes if it fails. There used to be no/little error
> checking here.
Oops! I just realised in the shower that those were process ids you were
returning, not exit codes. (Which makes questions 1 and 2 rather
nonsensical; sorry about that).
> doesn't carry with it any exit code, because no program was run.
>
> >3) I'm a bit nervous about catching ExitFailure at main - it seems like
> > this is something we would want to bubble up. How do you know this
> > doesn't misreport ExitFailures thrown by darcs itself?
>
> It is better than the current status I think - right now these failures
> pass unseen and if here is a failure, the desired side effects never take
> place. This way darcs realizes that there's a problem and bails out. Darcs
> itself shouldn't throw any ExecFailure. Only Exec.hs should throw
> ExecFailure.
Oh, I see; that is a new exception type _Exec_Failure, hence the
catchDyn, not ExitFailure, which for that matter probably doesn't even
exist (exitFailure). Consider me less nervous.
A new question for you
5) Why use bug? This indicates that darcs itself is broken; is an
ExecFailure an indication that darcs is broken?
All the best,
--
Eric Kow http://www.loria.fr/~kow
PGP Key ID: 08AC04F9 Merci de corriger mon français.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://lists.osuosl.org/pipermail/darcs-devel/attachments/20060929/635093a0/attachment.pgp
More information about the darcs-devel
mailing list