-
Notifications
You must be signed in to change notification settings - Fork 1.4k
fix: use-resource not catching onRejected #8197
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: use-resource not catching onRejected #8197
Conversation
🦋 Changeset detectedLatest commit: 7d62aa2 The changes in this PR will be included in the next version bump. This PR includes no changesetsWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types 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 |
commit: |
built with Refined Cloudflare Pages Action⚡ Cloudflare Pages Deployment
|
JerryWu1234
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic looks solid. By attaching a dummy catch. we prevent the runtime from flagging the promise as "unhandled" before our custom onRejected handler has a chance to process the state.
Nit: Please add a comment like // Suppress unhandled rejection warning above the line so future contributors don't remove it thinking it's mistake
wmertens
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.

What is it?
Description
It used to be like that and got removed by inadvertance in e33abbb I think. This causes some cypress component tests to fail because of unhandled rejection errors.
Checklist
pnpm change