I wanted to give this one a go (as it's tagged as low-hanging-fruit and so I thought it'd be a good choice for me to get started) and after playing with quantum a bit I think a fix for this would have to go in Resource.__call__(). I'm thinking that the most appropriate thing to do would be to have a separate except block there catching everything that's not a webob.exc.HTTPException, and treat those as internal errors, logging them but not including the original exception in the Fault() object returned. Something like:
That way the error messages of "expected" exceptions (i.e. those wrapped in an HTTPException by @common.APIFaultWrapper) will be sent to the client but everything else will be sent to clients with a generic "internal error" message.
I wanted to give this one a go (as it's tagged as low-hanging-fruit and so I thought it'd be a good choice for me to get started) and after playing with quantum a bit I think a fix for this would have to go in Resource. __call_ _(). I'm thinking that the most appropriate thing to do would be to have a separate except block there catching everything that's not a webob.exc. HTTPException, and treat those as internal errors, logging them but not including the original exception in the Fault() object returned. Something like:
try:
action_ result = self.dispatch( request, action, args) HTTPException as ex:
LOG. info(_( "HTTP exception thrown: %s"), unicode(ex))
action_ result = Fault(ex,
self. _xmlns,
self. _fault_ body_function)
LOG. exception( "Internal error: %s", unicode(exc))
action_ result = Fault(exception .Error( "Internal error"),
self. _xmlns,
self. _fault_ body_function)
except webob.exc.
except Exception as exc:
That way the error messages of "expected" exceptions (i.e. those wrapped in an HTTPException by @common. APIFaultWrapper ) will be sent to the client but everything else will be sent to clients with a generic "internal error" message.
Does this sound reasonable?