improving error handling

Neven Has haski at sezampro.yu
Thu Jan 18 11:57:49 PST 2001


I committed a suggestion for better error handling. 

There is a new subroutine called send_error() which would be used for
constructing error type messages that would be sent to a frontend. It returns
input from the user and based on that input we do certain things in tag handlers
like retrying, continuing, ignoring an error etc. I left opening a shell to be
handled by a frontend. Also, send_error() should really return a new message
sent from the frontend and not just user input, but we'll leave that for later 
phases when we start developing messaging system.

The example for all this is in tag_mkdir() subroutine, chdir() part of it (read
the comments too). So to test it, you can use something like:

	<mkdir dir="/non/existing/dir">dir1 dir2</mkdir>

The reason for approach like this is because I think we should allow 
_different_ error handling for each tag handler.
Using error(), like we do now, is not very flexible IMHO, because some handlers
should not, for example, allow ignoring an error, for others opening a shell 
to fix a problem could not help etc.
Also, with the current error handling we can not, for example, easily "retry" 
the action that failed.

Anyway, this is only a suggestion, and I would like to know what you think about
it and should I continue adding this for other subs and handlers or should I
remove it.

BTW, the downside of it is that the tag handlers would become a bit larger. 
tag_mkdir(), for example, would have 3 checks: for chdir(), for actual 
mkdir() and finally for chmod(). 
But if we split ... well, read my second email. :)

Neven







More information about the alfs-discuss mailing list