Handle exceptions caused during processing of requests, to improve error

reporting.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
This commit is contained in:
emellor@ewan committed 2005-09-28 13:41:44 +01:00
1 parent 817fbb6432
commit d391a2dddc
1 file changed
+8 -1
+8 -1
View File
@@ -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.
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.