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

fix: rethrow errors from await block if no catch block exists #13819

Merged
merged 8 commits into from
Oct 25, 2024
Merged

Conversation

trueadm
Copy link
Contributor

@trueadm trueadm commented Oct 23, 2024

Closes #13817

Copy link

changeset-bot bot commented Oct 23, 2024

🦋 Changeset detected

Latest commit: 3c46a55

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

This PR includes changesets to release 1 package
Name Type
svelte 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

@trueadm trueadm changed the title Await error chore: highlight swallowed errors from await blocks in DEV Oct 23, 2024
@Rich-Harris
Copy link
Member

Any reason we shouldn't just rethrow the error? The {:catch ...} conceptually is the .catch(...), so if it's missing and there's an error then rethrowing it feels appropriate. And why only do it in dev?

@dummdidumm
Copy link
Member

agree we should just rethrow, same behavior as Svelte 4 then. It shouldn't mess with the rest of the runtime anyway since it's a new microtask

@trueadm trueadm changed the title chore: highlight swallowed errors from await blocks in DEV fix: rethrow errors from await block if no catch block exists Oct 25, 2024
Copy link

pkg-pr-new bot commented Oct 25, 2024

pnpm add https://pkg.pr.new/svelte@13819

commit: 3c46a55

@trueadm
Copy link
Contributor Author

trueadm commented Oct 25, 2024

Fixed and added a test

@trueadm trueadm merged commit 7bbaedd into main Oct 25, 2024
9 checks passed
@trueadm trueadm deleted the await-error branch October 25, 2024 19:38
@github-actions github-actions bot mentioned this pull request Oct 25, 2024
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.

reactive variable using $state breaks when updated inside #await
3 participants