Skip to content

[#466] Improve `readContract`'s error message

Diogo Castro requested to merge diogo/cleanup-v2 into master

Description

Problem: ImportContractError will be displayed in one line. The error message contains two michelson types, and these types can get very big (see: https://github.com/tqtezos/stablecoin/pull/135#discussion_r530850855). This makes the message really hard to read and to spot where the difference between the two types is.

Additionally ICEUnexpectedParamType/ICEUnexpectedStorageType will show the unexpected Type with annotations and the expected Type without annotations. Again, this makes it harder to spot the difference between the two types, which can be very subtle.

Solution:

  1. Display the error in multiple lines, each type goes on its own line
  2. Show both the expected and unexpected types without annotations

Related issue(s)

Resolves #466 (closed)

Checklist for your Merge Request

Related changes (conditional)

  • Tests (see short guidelines)

    • If I added new functionality, I added tests covering it.
    • If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again.
  • Documentation

    • I checked whether I should update the docs and did so if necessary:
    • I updated changelog files of all affected packages released to Hackage if my changes are externally visible.

Stylistic guide (mandatory)

Merge request reports