hyperledger-iroha / iroha

Iroha - A simple, enterprise-grade decentralized ledger
https://wiki.hyperledger.org/display/iroha
Apache License 2.0
438 stars 280 forks source link

fix(torii): display more error details #4973

Closed 0x009922 closed 2 months ago

0x009922 commented 2 months ago

Description

While submitting an invalid transaction to Iroha, I got a response 400 Bad Request with message

Failed to accept transaction

That was not very helpful. This PR extends this message:

Failed to accept transaction

Caused by:
    Chain id doesn't correspond to the id of current blockchain: Expected ChainId("00000000-0000-0000-0000-000000000000"), actual ChainId("0")

Iroha has detailed errors internally, but their formatting doesn't work properly.

This PR does not aim to fix the issue entirely, but only highlights & fixes a special case of it. The main issue is #4974

Linked issue

Related to #4974

Benefits

Better error messages at least on the highest level of Torii.