frandiox/vite-ssr

Throw and catch errors?

lautiamkok opened this issue · 0 comments

How do we throw and catch errors with this plugin?

For example, if I throw an error on a page:

// about.vue
const { data } = await useFetch(`/contact`)
if (data === null) {
  throwError('No data!', 500)
}

How can we catch that error with vite-ssr?