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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

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: 06ddbba

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 Patch

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Improved Cadence Error Reporting
2 participants