fix(rln-relay): should error out on rln-relay mount failure (#1904)

This commit is contained in:
Aaryamann Challani 2023-08-16 19:00:10 +05:30 committed by GitHub
parent 78690787fb
commit 8c568cabbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 4 deletions

View File

@ -663,8 +663,7 @@ when defined(rln):
info "mounting rln relay"
if node.wakuRelay.isNil():
error "WakuRelay protocol is not mounted, cannot mount WakuRlnRelay"
return
raise newException(CatchableError, "WakuRelay protocol is not mounted, cannot mount WakuRlnRelay")
# TODO: check whether the pubsub topic is supported at the relay level
# if rlnConf.rlnRelayPubsubTopic notin node.wakuRelay.defaultPubsubTopics:
# error "The relay protocol does not support the configured pubsub topic for WakuRlnRelay"
@ -672,8 +671,7 @@ when defined(rln):
let rlnRelayRes = await WakuRlnRelay.new(rlnConf,
registrationHandler)
if rlnRelayRes.isErr():
error "failed to mount WakuRlnRelay", error=rlnRelayRes.error
return
raise newException(CatchableError, "failed to mount WakuRlnRelay: {rlnRelayRes.error}")
let rlnRelay = rlnRelayRes.get()
let validator = generateRlnValidator(rlnRelay, spamHandler)
let pb = PubSub(node.wakuRelay)