Nuxt/examples/with-errors/middleware/error.global.ts

6 lines
137 B
TypeScript
Raw Normal View History

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