Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework Cast CLI errors #2572

Closed
integraledelebesgue opened this issue Oct 8, 2024 · 1 comment
Closed

Rework Cast CLI errors #2572

integraledelebesgue opened this issue Oct 8, 2024 · 1 comment

Comments

@integraledelebesgue
Copy link
Member

Component the issue is related to

Cast

Issue

Errors in Cast are propagated in a few inconsistent ways:

  1. unwrap or expect - not only for strictly critical errors like runtime instantiation, but also for things like failed compilation (see here)

  2. A nice error descriptions generated by print_command_result, e.g.

command: invoke
error: An error occurred in the called contract[..]Requested contract address 0x1 is not deployed[..]

Those appear only for errors thrown by main command handlers (e.g. starknet_commands::declare::declare) and no other errors possible to occur during command execution.

  1. anyhow::Error returned by main::run_async_command - errors from helper functions like get_block_id (here) called before the main command handler are just propagated upwards and get printed in the console with no command info present in 2.

We could introduce consistent error handling accross all cast functionalities by substituting expects with bails and moving print_command_result calls outside the giant match in run_async_command so all the errors are presented to user in the same style.
Perhaps some extension/rework of print_command_result is necessary.

@cptartur
Copy link
Member

cptartur commented Nov 4, 2024

Closing in favor of #2604 #2536

@cptartur cptartur closed this as not planned Won't fix, can't repro, duplicate, stale Nov 4, 2024
@github-project-automation github-project-automation bot moved this from Backlog to Done in Starknet foundry Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

2 participants