forked from LBRYCommunity/lbry-sdk
log errors for on_rpc
This commit is contained in:
parent
25b63c988f
commit
39ba2a8b7f
1 changed files with 10 additions and 6 deletions
|
@ -137,12 +137,16 @@ class Daemon:
|
||||||
data = await request.json()
|
data = await request.json()
|
||||||
params = data.get('params', {})
|
params = data.get('params', {})
|
||||||
method = getattr(self.api, data['method'])
|
method = getattr(self.api, data['method'])
|
||||||
|
try:
|
||||||
result = await method(**params)
|
result = await method(**params)
|
||||||
encoded_result = jsonrpc_dumps_pretty(result, service=self.service)
|
encoded_result = jsonrpc_dumps_pretty(result, service=self.service)
|
||||||
return Response(
|
return Response(
|
||||||
text=encoded_result,
|
text=encoded_result,
|
||||||
content_type='application/json'
|
content_type='application/json'
|
||||||
)
|
)
|
||||||
|
except Exception as e:
|
||||||
|
log.exception("RPC error")
|
||||||
|
raise e
|
||||||
|
|
||||||
async def on_connect(self, request):
|
async def on_connect(self, request):
|
||||||
web_socket = WebSocketManager()
|
web_socket = WebSocketManager()
|
||||||
|
|
Loading…
Reference in a new issue