catch CancelledError in BlockExchange

This commit is contained in:
Eric 2025-11-10 21:03:24 +11:00
parent b701e08a56
commit 46413c8dff
No known key found for this signature in database

View File

@ -716,6 +716,8 @@ proc blocksDeliveryHandler*(
).errorOption:
warn "Unable to store proof and cid for a block"
continue
except CancelledError:
trace "Block delivery handling cancelled"
except CatchableError as exc:
warn "Error handling block delivery", error = exc.msg
continue
@ -963,6 +965,8 @@ proc blockexcTaskRunner(self: BlockExcEngine) {.async: (raises: []).} =
while self.blockexcRunning:
let peerCtx = await self.taskQueue.pop()
await self.taskHandler(peerCtx)
except CancelledError:
trace "block exchange task runner cancelled", peer = peerCtx.id
except CatchableError as exc:
error "error running block exchange task", error = exc.msg