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: handle errors thrown in await catch attrs #2005

Merged
merged 1 commit into from
Aug 4, 2023

Conversation

rturnq
Copy link
Contributor

@rturnq rturnq commented Jul 26, 2023

Description

Handles errors thrown within an await catch attribute using out.error to propagate the error to the response in the same way an await tag without a catch would.

Throwing an error in catch would be an unhandled error which could cause the server to crash.

Checklist:

  • I have read the CONTRIBUTING document and have signed (or will sign) the CLA.
  • I have updated/added documentation affected by my changes.
  • I have added tests to cover my changes.

@changeset-bot
Copy link

changeset-bot bot commented Jul 26, 2023

🦋 Changeset detected

Latest commit: ac387dc

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

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

@codecov
Copy link

codecov bot commented Jul 26, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.02% ⚠️

Comparison is base (59dd026) 88.96% compared to head (ac387dc) 88.94%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2005      +/-   ##
==========================================
- Coverage   88.96%   88.94%   -0.02%     
==========================================
  Files         212      212              
  Lines       17413    17417       +4     
==========================================
+ Hits        15491    15492       +1     
- Misses       1922     1925       +3     
Files Changed Coverage Δ
...ackages/marko/src/core-tags/core/await/renderer.js 68.46% <100.00%> (-0.74%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@DylanPiercey DylanPiercey merged commit 4286236 into main Aug 4, 2023
8 of 9 checks passed
@DylanPiercey DylanPiercey deleted the await-rethrow-errors branch August 4, 2023 22:16
@github-actions github-actions bot mentioned this pull request Aug 4, 2023
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