interface.debug will now also print errors

This commit is contained in:
SomberNight 2019-06-26 01:16:34 +02:00
parent 62e6ca50e1
commit 4fc43da344
No known key found for this signature in database
GPG key ID: B33B5F232C6271E9

View file

@ -38,7 +38,7 @@ import logging
import aiorpcx
from aiorpcx import RPCSession, Notification, NetAddress
from aiorpcx.curio import timeout_after, TaskTimeout
from aiorpcx.jsonrpc import JSONRPC
from aiorpcx.jsonrpc import JSONRPC, CodeMessageError
from aiorpcx.rawsocket import RSClient
import certifi
@ -115,6 +115,9 @@ class NotificationSession(RPCSession):
timeout)
except (TaskTimeout, asyncio.TimeoutError) as e:
raise RequestTimedOut(f'request timed out: {args} (id: {msg_id})') from e
except CodeMessageError as e:
self.maybe_log(f"--> {repr(e)} (id: {msg_id})")
raise
else:
self.maybe_log(f"--> {response} (id: {msg_id})")
return response