From 334b86e892b2d4f93bba949a0d520a57f7b1946c Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Mon, 8 Aug 2022 13:38:33 +0200 Subject: [PATCH] fix(nuxt): do not log `404` and `showError` as fatal by default --- 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 e50c8b72500..729ded637db 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 34502c4885e..190ad20cc79 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) {