Skip to content

Commit fc3aba3

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

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,11 @@ class TestEthBlockServiceWrapper(blockchain: Blockchain, ledger: Ledger, consens
3131
.getByBlockHash(request)
3232
.map(
3333
_.map(blockByBlockResponse => {
34+
import io.iohk.ethereum.utils.ByteStringUtils._
3435
blockByBlockResponse.blockResponse
35-
.toRight("missing block response")
36+
.toRight(s"EthBlockService: unable to find block for hash ${request.blockHash.toHex}")
3637
.flatMap(baseBlockResponse => baseBlockResponse.hash.toRight(s"missing hash for block $baseBlockResponse"))
37-
.flatMap(hash => ledger.getBlockByHash(hash).toRight(s"unable to find block for hash=$hash"))
38+
.flatMap(hash => ledger.getBlockByHash(hash).toRight(s"Ledger: unable to find block for hash=${hash.toHex}"))
3839
.map(fullBlock =>
3940
BlockByBlockHashResponse(
4041
blockByBlockResponse.blockResponse.map(response => toEthResponse(fullBlock, response))

0 commit comments

Comments
 (0)