darcs

Issue 1443 task: Formalize non-fault failure conditions

Title task: Formalize non-fault failure conditions
Priority wishlist Status resolved
Milestone Resolved in
Superseder Nosy List darcs-devel, dmitry.kurochkin, kowey, thorkilnaur, twb
Assigned To
Topics Devel

Created on 2009-04-16.11:08:23 by twb, last changed 2023-03-29.09:03:46 by bfrk.

Messages
msg7710 (view) Author: twb Date: 2009-04-16.11:08:20
Consider a case such as this:

    $ darcs get darcs get http://darcs.net

    darcs failed:  You must provide 'get' with either one or two arguments.

This is a non-fault failure -- the program failed, not because of a
bug (fault) in Darcs, but because of a mistake outside of Darcs.

Currently we have impossible.h to handle faults consistently.  You can
look for calls to impossible.h's definitions to find all the expected
fault modes.

We don't have anything like this for expected failures modes.
Instead, we just have base/fallback cases like

    f [] = putStrLn "You gave darcs wrong arguments."

Would Darcs benefit in code clarity by handing failures consistently,
as we do for faults?  At the very least, the help strings printed in
such cases could be vastly improved.  In the "darcs get" example
above, get's usage could be printed, and it could tell the user that
he passed three arguments.  (The latter is important when calling
darcs from a script, since without tracing, it may not be obvious that
there ARE three arguments in the darcs get call.)
msg23226 (view) Author: bfrk Date: 2023-03-29.09:03:46
Fixed long ago. We nowadays strictly distinguish between internal 
errors i.e. bugs (by calling error) and "normal" failure (by calling 
fail or throwing any other IO exception).
History
Date User Action Args
2009-04-16 11:08:23twbcreate
2009-04-22 03:05:24twbsetpriority: wishlist
nosy: kowey, simon, twb, thorkilnaur, dmitry.kurochkin
2009-08-18 19:53:05koweysetstatus: unread -> needs-implementation
nosy: kowey, simon, twb, thorkilnaur, dmitry.kurochkin
topic: + UI
2009-08-25 17:43:45adminsetnosy: + darcs-devel, - simon
2009-08-27 14:27:26adminsetnosy: kowey, darcs-devel, twb, thorkilnaur, dmitry.kurochkin
2010-04-04 09:26:19koweysettopic: + Devel, - UI
title: Formalize non-fault failure conditions -> task: Formalize non-fault failure conditions
2023-03-29 09:03:46bfrksetstatus: needs-implementation -> resolved
messages: + msg23226