improving error handling

Bryan Dumm bdumm at
Thu Jan 18 14:11:51 PST 2001

On Thursday 18 January 2001 19:57, you wrote:
> 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.

Hmmm, I really like the way you have implemented the send_error information.
But. Thinking about it, and say all the other print messages that are in the 
subroutines now, how about instead of send_error() we have 


with some sort of different ways to make up messages? Like error ones, 
response ones, general info ones, etc.? 

That way we really define these types of messages in XML and not through
different subroutines?


> 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