catch error handling

This commit is contained in:
Jaremy Creechley 2023-08-01 18:07:56 -07:00
parent d1fd4176cf
commit 6acb091279
No known key found for this signature in database
GPG Key ID: 4E66FB67B21D3300

View File

@ -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