Adds error logs to debugDelete

This commit is contained in:
Ben 2024-05-23 08:48:13 +02:00
parent 636473399a
commit c72a671527
No known key found for this signature in database
GPG Key ID: 541B9D8C9F1426A1
1 changed files with 2 additions and 1 deletions

View File

@ -516,7 +516,7 @@ proc requestStorage*(
proc debugDelete*(self: CodexNodeRef, cid: Cid, blockIndices: seq[int]): Future[?!int] {.async.} =
without manifest =? (await self.fetchManifest(cid)), err:
trace "Unable to fetch manifest for cid", cid, err = err.msg
error "Unable to fetch manifest for cid", cid, err = err.msg
return failure(err)
let
@ -534,6 +534,7 @@ proc debugDelete*(self: CodexNodeRef, cid: Cid, blockIndices: seq[int]): Future[
var deleted = 0
for index in blockIndices:
if err =? (await self.networkStore.delBlock(treeCid, index)).errorOption:
error "Failed to delete block", treeCid, index, err = err.msg
return failure(err)
inc deleted