Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: avoid using the msg key in chronicles #2970

Merged
merged 1 commit into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions waku/node/waku_node.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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))
Expand Down
4 changes: 2 additions & 2 deletions waku/node/waku_switch.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion waku/waku_api/rest/relay/handlers.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading