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

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

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

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

Conversation

@Matix-Media

@Matix-MediaMatix-Media commented May 2, 2022

Copy link
Copy Markdown
Contributor

🔗 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 fixesnuxt/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

netlifyBot commented May 2, 2022

Copy link
Copy Markdown

Deploy Preview for nuxt3-docs canceled.

NameLink
🔨 Latest commit1a28a45
🔍 Latest deploy loghttps://app.netlify.com/sites/nuxt3-docs/deploys/626fd7b5bbb29a0008b580ac

@Matix-MediaMatix-Media changed the title fix: added error.data to response | issue #4728fix(nitro): added error.data to response | issue #4728May 2, 2022
@pi0pi0 changed the title fix(nitro): added error.data to response | issue #4728fix(nuxt): preserve error.data in responseMay 2, 2022
pi0
pi0 approved these changes May 2, 2022

@pi0pi0 left a comment

Copy link
Copy Markdown
Member

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:mainMay 2, 2022
@pi0pi0 mentioned this pull request May 2, 2022
Sign up for freeto 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

@Matix-Media@pi0@danielroe