mirror of
https://github.com/logos-storage/logos-storage-nim.git
synced 2026-04-01 18:33:07 +00:00
catch error handling
This commit is contained in:
parent
d1fd4176cf
commit
6acb091279
@ -118,11 +118,7 @@ proc isEmpty*(blk: Block): bool =
|
||||
blk.cid.isEmpty
|
||||
|
||||
proc emptyBlock*(cid: Cid): Block =
|
||||
EmptyBlock[cid.cidver]
|
||||
.catch
|
||||
.get()[cid.mhash.get().mcodec]
|
||||
.catch
|
||||
.get()
|
||||
emptyBlock(cid.cidver, cid.mhash.get().mcodec).get()
|
||||
|
||||
proc `$`*(b: Block): string =
|
||||
result &= "cid: " & $b.cid
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user