hyperledger / iroha-javascript

JavaScript library for Iroha, a Distributed Ledger Technology (blockchain) platform.
https://wiki.hyperledger.org/display/iroha
Apache License 2.0
94 stars 64 forks source link

Proposal: throw explanatory errors in case of decoding errors #147

Open 0x009922 opened 1 year ago

0x009922 commented 1 year ago

@iroha2/data-model is built on a particular version of Iroha 2, and there might be compatibility issues with other version of how structures are (de)serialised. It might cause confusing errors like #126.

I propose to wrap places where @iroha2/client makes Torii requests and decodes their responses with code that catches possible decoding errors and prints a meaningful warning with text like "this library targets Iroha 2 version xxx - please ensure that you're communicating with Iroha of the same version".