async def run_handler(self, request: RPCRequest) -> Union[RPCReply, RPCError]:
        """
        Process a JSON RPC request

        :param RPCRequest request: JSON RPC request
        :return: JSON RPC reply
        """
        with catch_warnings(record=True) as warnings:
            try:
                rpc_handler = self.get_handler(request)
            except RPCMethodError as e:
                return rpc_error(request.id, str(e), warnings=warnings)

            try:
                # Run RPC and get result
                args, kwargs = get_input(request.params)
                result = rpc_handler(*args, **kwargs)

                if asyncio.iscoroutine(result):
                    result = await result

            except Exception as e:
                if self.serialize_exceptions:
                    _traceback = traceback.format_exc()
                    _log.error(_traceback)
                    if self.provide_tracebacks:
                        return rpc_error(request.id, "{}\n{}".format(str(e), _traceback),
                                         warnings=warnings)
                    else:
                        return rpc_error(request.id, str(e), warnings=warnings)
                else:
                    raise e

            return rpc_reply(request.id, result, warnings=warnings)
async def run_handler ( self , request : RPCRequest ) -> Union [ RPCReply , RPCError ] : with catch_warnings ( record = True ) as warnings : try : rpc_handler = self . get_handler ( request ) except RPCMethodError as e : return rpc_error ( request . id , str ( e ) , warnings = warnings ) try : args , kwargs = get_input ( request . params ) result = rpc_handler ( * args , ** kwargs ) if asyncio . iscoroutine ( result ) : result = await result except Exception as e : if self . serialize_exceptions : _traceback = traceback . format_exc ( ) _log . error ( _traceback ) if self . provide_tracebacks : return rpc_error ( request . id , "{}\n{}" . format ( str ( e ) , _traceback ) , warnings = warnings ) else : return rpc_error ( request . id , str ( e ) , warnings = warnings ) else : raise e return rpc_reply ( request . id , result , warnings = warnings )
Process a JSON RPC request

        :param RPCRequest request: JSON RPC request
        :return: JSON RPC reply