Skip to content
This repository was archived by the owner on Apr 6, 2023. It is now read-only.

fix(nuxt): preserve error.data in response#4755

Merged
pi0 merged 2 commits intonuxt:mainfrom
Matix-Media:main
May 2, 2022
Merged

fix(nuxt): preserve error.data in response#4755
pi0 merged 2 commits intonuxt:mainfrom
Matix-Media:main

Conversation

@Matix-Media
Copy link
Copy Markdown
Contributor

@Matix-Media Matix-Media commented May 2, 2022

🔗 Linked issue

createError does not return data nuxt/nuxt#13881

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 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)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

The current error errorhandler implementation does not put the data object into the response. By adding the data object received from the _error object to the errprObject we can add the data to the response. This fixes nuxt/nuxt#13881.
It is not required to check if the object exists, as it will automatically not be appended to the errorObject if it is undefined.

📝 Checklist

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

@netlify
Copy link
Copy Markdown

netlify Bot commented May 2, 2022

Deploy Preview for nuxt3-docs canceled.

Name Link
🔨 Latest commit 1a28a45
🔍 Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/626fd7b5bbb29a0008b580ac

@Matix-Media Matix-Media changed the title fix: added error.data to response | issue #4728 fix(nitro): added error.data to response | issue #4728 May 2, 2022
@pi0 pi0 changed the title fix(nitro): added error.data to response | issue #4728 fix(nuxt): preserve error.data in response May 2, 2022
Copy link
Copy Markdown
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@pi0 pi0 merged commit ffb9f71 into nuxt:main May 2, 2022
@pi0 pi0 mentioned this pull request May 2, 2022
@danielroe danielroe added the 3.x label Jan 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

createError does not return data

3 participants