Previously when an error occurred while importing a smart contract from the build directory during the deploy step, the zkApp CLI would swallow the error and display the message.
Failed to find the "Add" smart contract in your build directory.
Please confirm that your config.json contains the name of the smart contract that you desire to deploy to this deploy alias.
There are many different errors that can happen while importing a smart contract. This caused a poor DX, and made it extremely hard for user to find the source of the real errors.
Solution
This PR improves the error handling for zk deploy when a smart contract is not found in the build directory. A custom error message is only shown to a user if the smart contract is not found in the build directory. All other errors are thrown otherwise, enabling users to identify the cause of the error.
Additionaly, the custom error message was improved to help a user troubleshoot the problem when a contract is not found in the build directory.
Description
Closes #329
Previously when an error occurred while importing a smart contract from the build directory during the deploy step, the
zkApp CLI
would swallow the error and display the message.There are many different errors that can happen while importing a smart contract. This caused a poor DX, and made it extremely hard for user to find the source of the real errors.
Solution
This PR improves the error handling for
zk deploy
when a smart contract is not found in the build directory. A custom error message is only shown to a user if the smart contract is not found in the build directory. All other errors are thrown otherwise, enabling users to identify the cause of the error.Additionaly, the custom error message was improved to help a user troubleshoot the problem when a contract is not found in the build directory.