Open integraledelebesgue opened 2 weeks ago
@integraledelebesgue please update this
I think we could at least retain behavior similar to older errors we had.
E.g. (as of writing this) instead of an error like that error: An error occurred in the called contract[..]Class with hash[..]is not declared[..]
we now throw "Error: Couldn't retrieve contract class with hash:
.
However, the RPC endpoint used to get contract class (and so an ABI) is throwing a very descriptive error https://github.com/starkware-libs/starknet-specs/blob/6d88b7399f56260ece3821c71f9ce53ec55f830b/api/starknet_api_openrpc.json#L522 in a case where contract is missing: We could handle that and show an information to the user that the contract is not declared to the network at all.
See #2572
Component the issue is related to
Cast - data transformer
Issue
Before introducing calldata transformation, commands used to throw quite verbose errors concerning e.g. absence of the requested class hash. They originated from blockifier. Since transformer was introduced, such errors are thrown earlier in the execution process and are less descriptive
I added a workaround for preserving old error messages despite throwing them from completely different place.
ContractError
s normally obtained after sending transaction to chain are created here and here to mimic the old behaviour.This isn't a nice solution though. Maybe we should rethink our error propagation logic and perform a revamp.