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

[fix] Send correct error message from TX preview failure #1378

Merged
merged 4 commits into from
Nov 12, 2024

Conversation

matiasbzurovski
Copy link
Contributor

@matiasbzurovski matiasbzurovski commented Nov 8, 2024

Changelog

  • If the transaction analysis fails with FailedTransactionPreview, we should send back the error message that Sargon determines (instead of "Unknown reason").
  • Stop appending ET failed to generate TX review before any error parsed during TX preview loading.
  • If the error is an unknown CommonError (meaning a specific message cannot be determined for it for this flow), include its code in the message sent back to the dApp.
  • Updates error messages to be more descriptive

Before vs After

Before

"message": "ET failed to generate TX review: Failed to retrive TX receipt from gateway: Unknown reason"
"message": "ET failed to generate TX review: Transaction Manifest contains forbidden instructions"

After

"message": "Error when generating TX preview: Unknown reason, code: 10093"
"message": "Transaction Manifest contains forbidden instructions"  
Before After

Copy link
Contributor

@CyonAlexRDX CyonAlexRDX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@GhenadieVP GhenadieVP merged commit 82baa7f into main Nov 12, 2024
6 checks passed
@GhenadieVP GhenadieVP deleted the fix-error-message branch November 12, 2024 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants