From 4ec68db3230f762e7a6bc8a5188c8b1befac7a5c Mon Sep 17 00:00:00 2001 From: pooya parsa Date: Mon, 8 Aug 2022 14:11:50 +0200 Subject: [PATCH] fix(nuxt): do not log `404` and `showError` as fatal by default (#6437) --- packages/nuxt/src/app/composables/error.ts | 1 - packages/nuxt/src/pages/runtime/router.ts | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nuxt/src/app/composables/error.ts b/packages/nuxt/src/app/composables/error.ts index e50c8b7250..729ded637d 100644 --- a/packages/nuxt/src/app/composables/error.ts +++ b/packages/nuxt/src/app/composables/error.ts @@ -10,7 +10,6 @@ export interface NuxtError extends H3Error {} export const showError = (_err: string | Error | Partial) => { const err = createError(_err) - err.fatal = true try { const nuxtApp = useNuxtApp() diff --git a/packages/nuxt/src/pages/runtime/router.ts b/packages/nuxt/src/pages/runtime/router.ts index 34502c4885..190ad20cc7 100644 --- a/packages/nuxt/src/pages/runtime/router.ts +++ b/packages/nuxt/src/pages/runtime/router.ts @@ -165,6 +165,7 @@ export default defineNuxtPlugin(async (nuxtApp) => { if (to.matched.length === 0) { callWithNuxt(nuxtApp, showError, [createError({ statusCode: 404, + fatal: false, statusMessage: `Page not found: ${to.fullPath}` })]) } else if (process.server && to.matched[0].name === '404' && nuxtApp.ssrContext) {