mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
Handle exceptions caused during processing of requests, to improve error
reporting. Signed-off-by: Ewan Mellor <ewan@xensource.com>
This commit is contained in:
1 parent
817fbb6432
commit
d391a2dddc
1 file changed
+8
-1
@@ -81,7 +81,14 @@ class SrvBase(resource.Resource):
|
||||
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.
|
||||
|
||||