From 0e0f6cdece2ba91a02dc3dd285f7a3e17604478a Mon Sep 17 00:00:00 2001 From: Gabriel mermelstein Date: Wed, 14 Aug 2024 10:52:11 +0200 Subject: [PATCH] avoid using the msg key in chronicles --- waku/node/waku_node.nim | 6 +++--- waku/node/waku_switch.nim | 4 ++-- waku/waku_api/rest/relay/handlers.nim | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/waku/node/waku_node.nim b/waku/node/waku_node.nim index d4e5ff74e6..3895f52312 100644 --- a/waku/node/waku_node.nim +++ b/waku/node/waku_node.nim @@ -397,14 +397,14 @@ proc publish*( if node.wakuRelay.isNil(): let msg = "Invalid API call to `publish`. WakuRelay not mounted. Try `lightpush` instead." - error "publish error", msg = msg + error "publish error", err = msg # TODO: Improve error handling return err(msg) let pubsubTopic = pubsubTopicOp.valueOr: node.wakuSharding.getShard(message.contentTopic).valueOr: let msg = "Autosharding error: " & error - error "publish error", msg = msg + error "publish error", err = msg return err(msg) #TODO instead of discard return error when 0 peers received the message @@ -1105,7 +1105,7 @@ proc lightpushPublish*( peerOpt = node.peerManager.selectPeer(WakuLightPushCodec) if peerOpt.isNone(): let msg = "no suitable remote peers" - error "failed to publish message", msg = msg + error "failed to publish message", err = msg return err(msg) elif not node.wakuLightPush.isNil(): peerOpt = some(RemotePeerInfo.init($node.switch.peerInfo.peerId)) diff --git a/waku/node/waku_switch.nim b/waku/node/waku_switch.nim index 65e7c19992..db1dc51bb2 100644 --- a/waku/node/waku_switch.nim +++ b/waku/node/waku_switch.nim @@ -30,7 +30,7 @@ proc getSecureKey(path: string): TLSPrivateKey {.raises: [Defect, IOError].} = let key = TLSPrivateKey.init(stringkey) return key except TLSStreamProtocolError as exc: - debug "exception raised from getSecureKey", msg = exc.msg + debug "exception raised from getSecureKey", err = exc.msg proc getSecureCert(path: string): TLSCertificate {.raises: [Defect, IOError].} = trace "Certificate path is.", path = path @@ -39,7 +39,7 @@ proc getSecureCert(path: string): TLSCertificate {.raises: [Defect, IOError].} = let cert = TLSCertificate.init(stringCert) return cert except TLSStreamProtocolError as exc: - debug "exception raised from getSecureCert", msg = exc.msg + debug "exception raised from getSecureCert", err = exc.msg proc withWssTransport*( b: SwitchBuilder, secureKeyPath: string, secureCertPath: string diff --git a/waku/waku_api/rest/relay/handlers.nim b/waku/waku_api/rest/relay/handlers.nim index 589100ead0..bbe9d94802 100644 --- a/waku/waku_api/rest/relay/handlers.nim +++ b/waku/waku_api/rest/relay/handlers.nim @@ -259,7 +259,7 @@ proc installRelayApiHandlers*( let pubsubTopic = node.wakuSharding.getShard(message.contentTopic).valueOr: let msg = "Autosharding error: " & error - error "publish error", msg = msg + error "publish error", err = msg return RestApiResponse.badRequest("Failed to publish. " & msg) # if RLN is mounted, append the proof to the message