diff --git a/tools/python/xen/web/SrvBase.py b/tools/python/xen/web/SrvBase.py index 49a9e058d1..e0b528fcc0 100644 --- a/tools/python/xen/web/SrvBase.py +++ b/tools/python/xen/web/SrvBase.py @@ -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 "
%s
" % str(exn) def print_path(self, req): """Print the path with hyperlinks.