archway-network / cli

Develop WASM smart contracts with the Archway network developer CLI
https://docs.archway.io
Apache License 2.0
44 stars 21 forks source link

fix(contracts): Improve readability of cosmwasm error messages #234

Closed eliasmpw closed 1 year ago

eliasmpw commented 1 year ago

Description

Currently the error messages from a failing cosmwasm transaction are displayed as-is, but it contains a little bit of fluff at the start that could be removed from the terminal output (but still be present in the DEBUG output)

Example:

Query failed with (6): rpc error: code = Unknown desc = failed to execute message; message index: 0: Error parsing into type dao_core::msg::MigrateMsg: Invalid type:
    migrate wasm contract failed [CosmWasm/wasmd@v0.32.0/x/wasm/keeper/keeper.go:436] With gas wanted: '300000000' and gas used: '121070' : unknown request
aelesbao commented 1 year ago

Since the return format of CosmWasm error messages is out of the CLI's control, we should keep them intact as they might contain important information for the developer.