Skip to content

feat: update error handler to latest upstream version#761

Merged
danielroe merged 1 commit intonuxt:mainfrom
wattanx:issue-631-port-error-handler-from-nuxt3
May 6, 2023
Merged

feat: update error handler to latest upstream version#761
danielroe merged 1 commit intonuxt:mainfrom
wattanx:issue-631-port-error-handler-from-nuxt3

Conversation

@wattanx
Copy link
Copy Markdown
Collaborator

@wattanx wattanx commented May 6, 2023

🔗 Linked issue

#631

❓ 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

I have ported the contents of nitro/error.ts from Nuxt 3. (I'm not very confident, though.)

By implementing it in the playground as shown below, I was able to confirm that the contents of the headers are not missing.

layouts/error.vue

<template>
  <div>Error page: {{ headers }}</div>
</template>

<script setup>
const { ssrContext } = useNuxtApp()
const headers = useState('headers', () => ssrContext?.req.headers)

</script>

📝 Checklist

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

@wattanx wattanx changed the title fix: port the error handler from nuxt3 feat: port the error handler from nuxt3 May 6, 2023
@danielroe
Copy link
Copy Markdown
Member

you are on 🔥

@danielroe danielroe changed the title feat: port the error handler from nuxt3 feat: update error handler to latest upstream version May 6, 2023
@danielroe danielroe merged commit e2be178 into nuxt:main May 6, 2023
@wattanx wattanx deleted the issue-631-port-error-handler-from-nuxt3 branch May 7, 2023 06:01
@danielroe danielroe mentioned this pull request Jun 20, 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