Nuxt/examples/with-errors/middleware/error.global.ts
Daniel Roe 5d58ef48af
feat(nitro, nuxt3): allow handling otherwise unhandled runtime errors (#3464)
Co-authored-by: pooya parsa <pyapar@gmail.com>
2022-03-11 09:22:16 +01:00

6 lines
137 B
TypeScript

export default defineNuxtRouteMiddleware((to) => {
if ('middleware' in to.query) {
return throwError('error in middleware')
}
})