(self)
Implement dispatch interface specified by WSGIController
Implement dispatch interface specified by WSGIController
Implement dispatch interface specified by WSGIController
def _dispatch_call(self):
        """Implement dispatch interface specified by WSGIController"""
        try:
            raw_response = self._inspect_call(self._func)
        except JSONRPCError, e:
            self._error = e.as_dict()
        except TypeError, e:
            # Insufficient args in an arguments dict v2 call.
            if 'takes at least' in str(e):
                err = _reserved_errors['invalid_params']
                self._error = err.as_dict()
            else:
                raise
        except Exception, e:
            log.debug('Encountered unhandled exception: %s', repr(e))
            err = _reserved_errors['internal_error']
            self._error = err.as_dict()

        response = dict(jsonrpc=JSONRPC_VERSION,
                        id=self._req_id)
        if self._error is not None:
            response['error'] = self._error
        else:
            response['result'] = raw_response

        try:
            return json.dumps(response)
        except TypeError, e:
            log.debug('Error encoding response: %s', e)
            err = _reserved_errors['internal_error']
            return json.dumps(dict(
                    jsonrpc=JSONRPC_VERSION,
                    id=self._req_id,
                    error=err.as_dict()))
def _dispatch_call ( self ) : try : raw_response = self . _inspect_call ( self . _func ) except JSONRPCError , e : self . _error = e . as_dict ( ) except TypeError , e : # Insufficient args in an arguments dict v2 call. if 'takes at least' in str ( e ) : err = _reserved_errors [ 'invalid_params' ] self . _error = err . as_dict ( ) else : raise except Exception , e : log . debug ( 'Encountered unhandled exception: %s' , repr ( e ) ) err = _reserved_errors [ 'internal_error' ] self . _error = err . as_dict ( ) response = dict ( jsonrpc = JSONRPC_VERSION , id = self . _req_id ) if self . _error is not None : response [ 'error' ] = self . _error else : response [ 'result' ] = raw_response try : return json . dumps ( response ) except TypeError , e : log . debug ( 'Error encoding response: %s' , e ) err = _reserved_errors [ 'internal_error' ] return json . dumps ( dict ( jsonrpc = JSONRPC_VERSION , id = self . _req_id , error = err . as_dict ( ) ) )