More precise tracing

This commit is contained in:
Zahary Karadjov 2020-02-04 17:27:32 +01:00
parent 7bd305471c
commit 1bd933cd5a
No known key found for this signature in database
GPG Key ID: C8936F8A3073D609
4 changed files with 5 additions and 5 deletions

View File

@ -148,7 +148,7 @@ proc handle*(m: MultisteamSelect, conn: Connection) {.async, gcsafe.} =
warn "no handlers for ", protocol = ms warn "no handlers for ", protocol = ms
await conn.write(m.na) await conn.write(m.na)
except CatchableError as exc: except CatchableError as exc:
trace "exception occured", exc = exc.msg trace "exception occurred in MultistreamSelect.handle", exc = exc.msg
finally: finally:
trace "leaving multistream loop" trace "leaving multistream loop"

View File

@ -62,7 +62,7 @@ proc handle*(p: PubSubPeer, conn: Connection) {.async.} =
await p.handler(p, @[msg]) await p.handler(p, @[msg])
p.recvdRpcCache.put($hexData.hash) p.recvdRpcCache.put($hexData.hash)
except CatchableError as exc: except CatchableError as exc:
error "exception occured", exc = exc.msg error "exception occurred in PubSubPeer.handle", exc = exc.msg
finally: finally:
trace "exiting pubsub peer read loop", peer = p.id trace "exiting pubsub peer read loop", peer = p.id
if not conn.closed(): if not conn.closed():
@ -100,7 +100,7 @@ proc send*(p: PubSubPeer, msgs: seq[RPCMsg]) {.async.} =
encoded = encodedHex encoded = encodedHex
except CatchableError as exc: except CatchableError as exc:
trace "exception occured", exc = exc.msg trace "exception occurred in PubSubPeer.send", exc = exc.msg
proc sendMsg*(p: PubSubPeer, proc sendMsg*(p: PubSubPeer,
peerId: PeerID, peerId: PeerID,

View File

@ -426,7 +426,7 @@ proc readLoop(sconn: SecureConnection, stream: BufferStream) {.async.} =
await stream.pushTo(msg) await stream.pushTo(msg)
except CatchableError as exc: except CatchableError as exc:
trace "exception occured", exc = exc.msg trace "exception occurred SecureConnection.readLoop", exc = exc.msg
finally: finally:
if not sconn.closed: if not sconn.closed:
await sconn.close() await sconn.close()

View File

@ -258,7 +258,7 @@ proc start*(s: Switch): Future[seq[Future[void]]] {.async, gcsafe.} =
try: try:
await s.upgradeIncoming(conn) # perform upgrade on incoming connection await s.upgradeIncoming(conn) # perform upgrade on incoming connection
except CatchableError as exc: except CatchableError as exc:
trace "exception occured", exc = exc.msg trace "exception occurred in Switch.start", exc = exc.msg
finally: finally:
if not isNil(conn) and not conn.closed: if not isNil(conn) and not conn.closed:
await conn.close() await conn.close()