Skip to content

Commit c62a8ce

Browse files
committed
[ETCM-927] improve error messages in EthBlockService.getBlockByHash()
1 parent f521a31 commit c62a8ce

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/scala/io/iohk/ethereum/testmode/TestEthBlockServiceWrapper.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,11 @@ class TestEthBlockServiceWrapper(
3333
.getByBlockHash(request)
3434
.map(
3535
_.map(blockByBlockResponse => {
36+
import io.iohk.ethereum.utils.ByteStringUtils._
3637
blockByBlockResponse.blockResponse
37-
.toRight("missing block response")
38+
.toRight(s"EthBlockService: unable to find block for hash ${request.blockHash.toHex}")
3839
.flatMap(baseBlockResponse => baseBlockResponse.hash.toRight(s"missing hash for block $baseBlockResponse"))
39-
.flatMap(hash => ledger.getBlockByHash(hash).toRight(s"unable to find block for hash=$hash"))
40+
.flatMap(hash => ledger.getBlockByHash(hash).toRight(s"Ledger: unable to find block for hash=${hash.toHex}"))
4041
.map(fullBlock =>
4142
BlockByBlockHashResponse(
4243
blockByBlockResponse.blockResponse.map(response => toEthResponse(fullBlock, response))

0 commit comments

Comments
 (0)