8000 docs: update rendering error page by mihul87 Β· Pull Request #22523 Β· nuxt/nuxt Β· GitHub
[go: up one dir, main page]

Skip to content

docs: update rendering error page #22523

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

Merged
merged 15 commits into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docs: update rendering error page
  • Loading branch information
mihul87 committed Aug 8, 2023
commit 299a3d9358a377435630d6295fffa9263173a53f
3 changes: 1 addition & 2 deletions playground/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
</script>

<template>
<!-- Edit this file to play around with Nuxt but never commit changes! -->
<div>
Nuxt 3 Playground
<NuxtPage />
</div>
</template>

Expand Down
12 changes: 12 additions & 0 deletions playground/error.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<template>
<div>{{error.message}}</div>
<div>{{error.details}}</div>
</template>

<script setup>
const props = defineProps({
error: Object
})

console.log(props.error)
</script>
11 changes: 11 additions & 0 deletions playground/pages/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<script setup>
const err = new Error('yikes!')
err.details = "Something happened!"
err.description = "Custom description."
err.data = 'Unfortunate.'
throw err
</script>

<template>
<div>Welcome, Human!</div>
</template>
6 changes: 6 additions & 0 deletions playground/plugins/erroplugin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.hook('vue:error', (err) => {
console.log('Erro from plugin: ', err)
})
})
0