From b7c736b34c76d5e8321a6d0af2a38d36497eabf5 Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Fri, 16 Feb 2024 09:00:23 -0600 Subject: [PATCH] =?UTF-8?q?use=20parens=20around=20`=3D=3F=20(await...)`?= =?UTF-8?q?=20calls?= --- codex/stores/networkstore.nim | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/codex/stores/networkstore.nim b/codex/stores/networkstore.nim index 82a1428d..c035f5bd 100644 --- a/codex/stores/networkstore.nim +++ b/codex/stores/networkstore.nim @@ -37,13 +37,16 @@ type method getBlock*(self: NetworkStore, address: BlockAddress): Future[?!Block] {.async.} = trace "Getting block from local store or network", address - without blk =? await self.localStore.getBlock(address), error: - if not (error of BlockNotFoundError): return failure error - trace "Block not in local store", address + without blk =? (await self.localStore.getBlock(address)), err: + if not (err of BlockNotFoundError): + trace "Error getting block from local store", address, err = err.msg + return failure err - without newBlock =? (await self.engine.requestBlock(address)).catch, error: - trace "Unable to get block from exchange engine", address - return failure error + trace "Block not in local store", address, err = err.msg + + without newBlock =? (await self.engine.requestBlock(address)), err: + trace "Unable to get block from exchange engine", address, err = err.msg + return failure err return success newBlock