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

PKG -- [fcl-core] Add TransactionError type to better expose execution errors #1893

Merged
merged 16 commits into from
Oct 24, 2024

Conversation

jribbink
Copy link
Contributor

@jribbink jribbink commented Jun 6, 2024

closes #1891

This helps expose errors in a more usable way for developers. They can now check the error code against a standardized set of enums to help them categorize errors better. This utility can also be used by wallet developers to surface failed transaction results to users.

I tried to make this implementation as change-proof as possible (doesn't edit the message/extract error message, code is optional, regex uses first occurance instead of start of string) because there are existing tickets in flow-go which aim to improve error reporting, so it's best to err on the side of caution and assume that this could change.

see:
onflow/flow-go#3781
onflow/cadence#2689

@jribbink jribbink requested a review from a team as a code owner June 6, 2024 07:22
Copy link

changeset-bot bot commented Jun 6, 2024

🦋 Changeset detected

Latest commit: f2416c0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@onflow/typedefs Minor
@onflow/fcl-core Minor
@onflow/fcl-react-native Patch
@onflow/fcl Patch
@onflow/sdk Patch
@onflow/fcl-wc Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@jribbink jribbink changed the title PKG -- [fcl] Add TransactionError type to better expose execution errors PKG -- [fcl-core] Add TransactionError type to better expose execution errors Jun 14, 2024
Copy link
Contributor

@nialexsan nialexsan left a comment

Choose a reason for hiding this comment

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

a small change request

packages/fcl-core/src/transaction/transaction-error.ts Outdated Show resolved Hide resolved
@jribbink jribbink merged commit b9f4949 into master Oct 24, 2024
1 check passed
@jribbink jribbink deleted the jribbink/tx-errors branch October 24, 2024 20:47
@github-actions github-actions bot mentioned this pull request Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

[FEATURE] Improved Cadence Error Reporting
3 participants