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

Improve error messages for developers using FCL #1980

Open
nialexsan opened this issue Oct 21, 2024 · 1 comment
Open

Improve error messages for developers using FCL #1980

nialexsan opened this issue Oct 21, 2024 · 1 comment
Assignees

Comments

@nialexsan
Copy link
Contributor

Parse cadence errors into a json structure

@jribbink
Copy link
Contributor

jribbink commented Oct 24, 2024

#1893 has just been merged, which is probably a good baby step. There's definitely more that can be done here (just wanted to drop a few of my ideas in case they are helpful)

  • TransactionError is only surfaced for fcl.tx().once predicates (i.e. onceSealed). We could add this to the txStatus in .subscribe potentially?
  • We don't have any well parsing in place for script errors. Ideally there would be a ScriptError type, maybe. And both this and TransactionError could maybe inherit from a common type (e.g. ExecutionError)
  • There's no parsing beyond the error code and no formatting of the message. It's just surfaced easier to devs mostly. This was intentionally done because we want to be cautious here. If we try to parse too much, we could end up with broken error parsing later down the line if flow-go changes. We should do everything in our power to avoid this (people update FCL VERY infrequently, and broken versions could end up polluting the dApp ecosystem).... that being said... if there's a future-proof way to do this, I'm all ears.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🆕 New
Development

No branches or pull requests

2 participants