WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH] suggested change in exception-handling style of

To: Daniel Miles <daniel.t.miles@xxxxxx>
Subject: Re: [Xen-devel] [PATCH] suggested change in exception-handling style of user-space tools
From: Ewan Mellor <ewan@xxxxxxxxxxxxx>
Date: Thu, 1 Jun 2006 12:11:33 +0100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 01 Jun 2006 04:49:06 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <1148401221.9142.17.camel@xxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1148401221.9142.17.camel@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.9i
On Tue, May 23, 2006 at 10:20:21AM -0600, Daniel Miles wrote:

> In the tools/python/xen/xm directory, main.py has good error messages
> that let the user know what failed; the other 'sub-command' classes
> don't always have such good messages which can lead to some inexplicable
> failures by the user-space tools.
> 
> Standard practice is to except each error by type and react accordingly
> but in case the programmer does not anticipate a type of exception,
> standard practice is to put in a catch-all exception handler that
> excepts an 'Exception' object. Often in this case, the system will print
> out the exception and exit.
> 
> If a sub-command excepts an 'Exception' object and the error is not
> specific to that sub-command, it should pass the exception up for main
> to handle. Especially in light of the fact that there is already a broad
> collection of good error messages in main, I believe that this will lead
> to better code re-use in the form of a one-stop-shop for error messages.
> In this patch I've changed only one of the general case exception
> handlers in one of the sub-commands (xm create) as a test-balloon to see
> if the xen community will accept future patches of this type.

Applied, thank you.  Patches for cleaning up the error handling and diagnosis
are always welcome, so feel free to send more!

> Singed-off-by: Daniel Miles <daniel.t.miles@xxxxxx>

I like the idea of a patch, gently burned around the edges ;-)

Ewan.

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • Re: [Xen-devel] [PATCH] suggested change in exception-handling style of user-space tools, Ewan Mellor <=