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(nuxt): wrap caught asyncData error in createError #24093

Merged
merged 6 commits into from Nov 8, 2023

Conversation

DamianGlowala
Copy link
Member

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

This PR addresses a case when asyncData handler's promise gets rejected and the error isn't an instance of the H3Error class. For instance, when watching the error property of the data fetching composable, it is currently triggered twice in this scenario. Firstly, it has a raw error value assigned, and only then an instance of H3Error, what leads to an inconsistent behavior.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

Copy link

stackblitz bot commented Nov 2, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@DamianGlowala DamianGlowala marked this pull request as draft November 3, 2023 13:15
@DamianGlowala DamianGlowala removed the request for review from danielroe November 3, 2023 13:15
@DamianGlowala DamianGlowala marked this pull request as ready for review November 3, 2023 22:42
@danielroe danielroe merged commit 61dd849 into main Nov 8, 2023
33 checks passed
@danielroe danielroe deleted the fix/useasyncdata-error-handling branch November 8, 2023 13:28
@github-actions github-actions bot mentioned this pull request Nov 8, 2023
manniL pushed a commit that referenced this pull request Dec 11, 2023
Co-authored-by: Bogdan Kostyuk <contact@bogdankostyuk.xyz>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants