Skip to content

Improve error message when trying to redeclare contract using sncast declare #3253

@cptartur

Description

@cptartur

Current State

Currently, we show something along the lines of

command: declare
error: Transaction execution error = TransactionExecutionErrorData { transaction_index: 0, execution_error: "Class with hash 0x0273a597e2dbb18296c788c471af35c99315bb738be1c8c854ca83b85a75bc98 is already declared." }

Objective

Show a specific error expaling that contract was already declared instead of dumping the RPC error directly

Additional Context

The error returned by an RPC is a specif one we can safely match by its type and display better message, that is nicely formatted (see the other tool for reference).

Metadata

Metadata

Assignees

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions