'Generate a WSGI response based on the exception passed to ctor.'

@webob.dec.wsgify(RequestClass=Request)
def __call__(self, req):

    (fault_data, metadata) = self._body_function(self.wrapped_exc)
    content_type = req.best_match_content_type()
    serializer = {'application/json': JSONDictSerializer()}[content_type]
    self.wrapped_exc.body = serializer.serialize(fault_data)
    self.wrapped_exc.content_type = content_type
    return self.wrapped_exc
