dfinity / sdk

IC SDK: a Software Development Kit for creating and managing canister smart contracts on the ICP blockchain.
https://internetcomputer.org/developers
Apache License 2.0
176 stars 85 forks source link

chore: improve `dfx cycles` messages. #3972

Closed vincent-dfinity closed 1 week ago

vincent-dfinity commented 2 weeks ago

Description

Improve the messages for the subcommands of dfx cycles to let users know what to do next.

$ dfx cycles balance
Error: The replica returned a rejection error: reject code DestinationInvalid, reject message IC0301: Canister um5iw-rqaaa-aaaaq-qaaba-cai not found, error code Some("IC0301")
Error explanation:
Cycles ledger with canister ID 'um5iw-rqaaa-aaaaq-qaaba-cai' is not installed.
How to resolve the error:
Run the command with '--ic' flag if you want to manage the cycles on the mainnet.

Fixes # (issue)

SDK-1864

How Has This Been Tested?

Added the e2e test.

Checklist: