def call_func(self, req, *args, **kwargs):
        """Add json_error_formatter to any webob HTTPExceptions."""
        try:
            return super(SdkWsgify, self).call_func(req, *args, **kwargs)
        except webob.exc.HTTPException as exc:
            msg = ('encounter %(error)s error') % {'error': exc}
            LOG.debug(msg)
            exc.json_formatter = json_error_formatter
            code = exc.status_int
            explanation = six.text_type(exc)

            fault_data = {
                'overallRC': 400,
                'rc': 400,
                'rs': code,
                'modID': SDKWSGI_MODID,
                'output': '',
                'errmsg': explanation}
            exc.text = six.text_type(json.dumps(fault_data))
            raise exc
def call_func ( self , req , * args , ** kwargs ) : try : return super ( SdkWsgify , self ) . call_func ( req , * args , ** kwargs ) except webob . exc . HTTPException as exc : msg = ( 'encounter %(error)s error' ) % { 'error' : exc } LOG . debug ( msg ) exc . json_formatter = json_error_formatter code = exc . status_int explanation = six . text_type ( exc ) fault_data = { 'overallRC' : 400 , 'rc' : 400 , 'rs' : code , 'modID' : SDKWSGI_MODID , 'output' : '' , 'errmsg' : explanation } exc . text = six . text_type ( json . dumps ( fault_data ) ) raise exc
Add json_error_formatter to any webob HTTPExceptions.