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

[Xen-changelog] Handle exceptions caused during processing of requests, to improve error



# HG changeset patch
# User emellor@ewan
# Node ID 1e288a9316fdff2967889ae9ac5d016fa4e996d2
# Parent  46046d5fb354ead9684ce43465856b676a975778
Handle exceptions caused during processing of requests, to improve error
reporting.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>

diff -r 46046d5fb354 -r 1e288a9316fd tools/python/xen/web/SrvBase.py
--- a/tools/python/xen/web/SrvBase.py   Tue Sep 27 21:09:46 2005
+++ b/tools/python/xen/web/SrvBase.py   Wed Sep 28 12:41:44 2005
@@ -81,7 +81,14 @@
             req.write("Operation not implemented: " + op)
             return ''
         else:
-            return op_method(op, req)
+            try:
+                res = op_method(op, req)
+            except Exception, exn:
+                log.exception("Request %s failed.", op)
+                if req.useSxp():
+                    return ['xend.err', "Exception: " + str(exn)]
+                else:
+                    return "<p>%s</p>" % str(exn)
 
     def print_path(self, req):
         """Print the path with hyperlinks.

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


 


Rackspace

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