-
Notifications
You must be signed in to change notification settings - Fork 124
Resolve contract error names from WASM spec during invocation #2377
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -132,7 +132,7 @@ pub enum Error { | |||||||||
| #[error(transparent)] | ||||||||||
| Locator(#[from] locator::Error), | ||||||||||
|
|
||||||||||
| #[error("Contract Error\n{0}: {1}")] | ||||||||||
| #[error("{0}")] | ||||||||||
|
||||||||||
| #[error("{0}")] | |
| #[error("{0}")] | |
| /// The first `String` is the enhanced user-facing message; the second contains | |
| /// additional detail that is not included in the formatted error output. |
Copilot
AI
Jan 29, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new submission-path enhancement (send_transaction_polling errors parsed via Contract(N)) isn’t covered end-to-end by the integration tests in this PR. Consider adding an integration test that exercises a transaction submission failure containing ScError::Contract(u32) and asserts the resolved error name/doc appear in the CLI output, so this path stays protected against regressions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be able to extract the error programatically, without string parsing, from the transaction result.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For functions that have in their signature a Result return value with a specific error type, I think this logic should probably limit its search to that specific error type.
It's always possible for a contract to panic with some other error inside that function. But if a contract function says in its spec those are the errors it will return, we should probably limit displaying those errors.