Skip to content

Commit

Permalink
fix: unhandled exception
Browse files Browse the repository at this point in the history
  • Loading branch information
rymnc committed Sep 6, 2023
1 parent 15bfde4 commit b058c97
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions waku/waku_rln_relay/group_manager/on_chain/group_manager.nim
Original file line number Diff line number Diff line change
Expand Up @@ -553,10 +553,15 @@ method isReady*(g: OnchainGroupManager): Future[bool] {.async,gcsafe.} =
if g.ethRpc.isNone():
return false

let currentBlock = cast[BlockNumber](await g.ethRpc
.get()
.provider
.eth_blockNumber())
var currentBlock: BlockNumber
try:
currentBlock = cast[BlockNumber](await g.ethRpc
.get()
.provider
.eth_blockNumber())
except CatchableError:
error "failed to get the current block number", error = getCurrentExceptionMsg()
return false

if g.latestProcessedBlock < currentBlock:
return false
Expand Down

0 comments on commit b058c97

Please sign in to comment.