[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.