You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Errors in Cast are propagated in a few inconsistent ways:
unwrap or expect - not only for strictly critical errors like runtime instantiation, but also for things like failed compilation (see here)
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.
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.
The text was updated successfully, but these errors were encountered:
Component the issue is related to
Cast
Issue
Errors in Cast are propagated in a few inconsistent ways:
unwrap
orexpect
- not only for strictly critical errors like runtime instantiation, but also for things like failed compilation (see here)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.
anyhow::Error
returned bymain::run_async_command
- errors from helper functions likeget_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
expect
s withbail
s and movingprint_command_result
calls outside the giantmatch
inrun_async_command
so all the errors are presented to user in the same style.Perhaps some extension/rework of
print_command_result
is necessary.The text was updated successfully, but these errors were encountered: