Skip to content

feat: add XYError #4540

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

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

feat: add XYError #4540

wants to merge 14 commits into from

Conversation

bcakmakoglu
Copy link
Contributor

🚀 What's changed?

  • Add XYError class to handle errors
  • Add XYErrorCode enum to handle assignable error codes
  • Add isXYError utility function to check if an error is an instance of XYError
  • Allow an object of XYError as third argument for the onError callback
    • Pass XYError when handling errors and pass it to the onError callback

🌻 Resolves

Copy link

changeset-bot bot commented Aug 12, 2024

🦋 Changeset detected

Latest commit: 3ac7650

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

This PR includes changesets to release 3 packages
Name Type
@xyflow/react Minor
@xyflow/svelte Minor
@xyflow/system Minor

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

@moklick
Copy link
Member

moklick commented Sep 23, 2024

Thanks for your help @bcakmakoglu . When I see it right this wouldn't be a breaking change anymore, since you just added another param to the onError function. Is that correct?

@bcakmakoglu
Copy link
Contributor Author

@moklick yep, that is correct :)

Seems like a conflict came up though, I'll update the PR asap

@BcakmakogluAI BcakmakogluAI force-pushed the feat/xy-error branch 2 times, most recently from d2cba01 to 78e0a63 Compare September 23, 2024 10:41
@bcakmakoglu
Copy link
Contributor Author

Could probably be improved by passing lib to the error as well so that the messages become something like [ReactFlow]: <message> / [SvelteFlow]: <message> if you'd like that

@bcakmakoglu bcakmakoglu force-pushed the feat/xy-error branch 2 times, most recently from b6eb282 to fd402bf Compare March 17, 2025 09:34
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.

2 participants