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
177 stars 85 forks source link

chore: improve dfx deploy message. #3967

Closed vincent-dfinity closed 2 weeks ago

vincent-dfinity commented 4 weeks ago

Description

Improve dfx deploy error message to let users know what to do next.

$ dfx deploy
Error: Failed to fetch the root key, did you run 'dfx start' to start the local replica?
An error happened during communication with the replica: error sending request for url (http://127.0.0.1:4943/api/v2/status)

Fixes # (issue)

SDK-1858

How Has This Been Tested?

Added an e2e test.

Checklist:

marydwyer commented 4 weeks ago

Is information about the rootkey at all relevent to the user? I'm wondering if we could streamline the message even further to something like this:

Error: Failed to deploy because your a replica is not running. Please run 'dfx start' and try again.

vincent-dfinity commented 3 weeks ago

Is information about the rootkey at all relevent to the user? I'm wondering if we could streamline the message even further to something like this:

Error: Failed to deploy because your a replica is not running. Please run 'dfx start' and try again.

  1. It just indicates where the error comes from.
  2. The reason why I use a question did you run 'dfx start' to start the local replica? is I'm not quite sure if it's the only reason to fail fetching the root key. @sesi200 do you know if there're any other cases?
vincent-dfinity commented 2 weeks ago

I'll close this pr as this issue has been addressed by this pr https://github.com/dfinity/sdk/pull/3973.