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

[Xen-devel] Re: Who gives exeption routine in main.py 'Not found' in ex

To: Yoshinori Katase <y_katase@xxxxxxxxxxxxxxxx>
Subject: [Xen-devel] Re: Who gives exeption routine in main.py 'Not found' in ex ?
From: Ewan Mellor <ewan@xxxxxxxxxxxxx>
Date: Mon, 9 Jan 2006 11:13:41 +0000
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Mon, 09 Jan 2006 11:18:36 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20060106095811.98D651C005@xxxxxxxxxxxxxxxxxxxxxxxxx>
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: <20051222153948.GE18194@xxxxxxxxxxxxxxxxxxxxxx> <20060106095811.98D651C005@xxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.9i
On Fri, Jan 06, 2006 at 06:58:59PM +0900, Yoshinori Katase wrote:

> Hi, Ewan.
> I investigated at your suggestion.
> 
> When un-existant domain name(id)s is given xm,
> exeption routine in main.py is carried 'Not found' in ex.
> 
> 932:        except xen.xend.XendError.XendError, ex:
> 933:            if len(args) > 0:
> 934:                handle_xend_error(argv[1], args, ex)
> 
> But in xend.trace, XendEroor shows error DomID.
> 
> |      43         if not dom:
> |      44             raise XendError('No such domain ' + str(x))
> |    |> XendError.py:__init__
> |    |  21         self.value = value
> |    |< XendError.py:__init__
> |    ! Exception:
> Traceback (most recent call last):
>   File "/usr/lib/python/xen/xend/server/SrvDomainDir.py", line 44, in domain
>     raise XendError('No such domain ' + str(x))
> XendError: No such domain 100
> |    ! Exception:
> Traceback (most recent call last):
>   File "/usr/lib/python/xen/xend/server/SrvDomainDir.py", line 52, in get
>     return self.domain(x)
>   File "/usr/lib/python/xen/xend/server/SrvDomainDir.py", line 44, in domain
>     raise XendError('No such domain ' + str(x))
> XendError: No such domain 100
> |    |> XendError.py:__str__
> |    |  24         return self.value
> |    |< XendError.py:__str__
> 
> Who changes xend's error massage ?

Deep in the depths of Xend's communication support (just past the adulterers
and fornicators, but before you reach the gluttonous and the slothful) you
will find xen.web.SrvDir.getChild.  This catches XendError and uses noChild
and then xen.web.resource.ErrorPage to convert the exception to an HTTP
response.  This response includes the exception message as the page message.
The HTTP response code "404 Not Found" is set by SrvDir.noChild.

In the client, in
xen.xend.XendProtocol.{xendRequest,handleStatus,handleException} the XendError
exception is recreated, but this time using the HTTP reason phrase rather than
the exception message.  So you get "Not found" from the "404 Not Found", and
you've lost the domain ID.

Almost any arrangement would be better than this one.  Please feel that you
have free rein to alter things here (assuming that it still works when you are
done ;-)

Thank you,

Ewan.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>