mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-01-04 06:53:12 +00:00
Don't crash on non WakuMessage in rpc subscribe (#175)
Instead, log stringified version. (This is used for other PoC right now.)
This commit is contained in:
parent
bcae93300a
commit
3100d86f24
@ -54,11 +54,11 @@ proc setupWakuRPC*(node: WakuNode, rpcsrv: RpcServer) =
|
|||||||
let msg = WakuMessage.init(data)
|
let msg = WakuMessage.init(data)
|
||||||
if msg.isOk():
|
if msg.isOk():
|
||||||
debug "waku_subscribe handler", msg=msg
|
debug "waku_subscribe handler", msg=msg
|
||||||
|
var readable_str = cast[string](msg[].payload)
|
||||||
|
info "Hit subscribe handler", topic=topic, msg=msg[], payload=readable_str
|
||||||
else:
|
else:
|
||||||
warn "waku_subscribe decode error", msg=msg
|
warn "waku_subscribe decode error", msg=msg
|
||||||
|
info "waku_subscribe raw data string", str=cast[string](data)
|
||||||
var readable_str = cast[string](msg[].payload)
|
|
||||||
info "Hit subscribe handler", topic=topic, msg=msg[], payload=readable_str
|
|
||||||
|
|
||||||
# XXX: Can we make this context async to use await?
|
# XXX: Can we make this context async to use await?
|
||||||
discard node.subscribe(topic, handler)
|
discard node.subscribe(topic, handler)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user