fix(nuxt): do not log 404 and showError as fatal by default (#6437)

This commit is contained in:
pooya parsa 2022-08-08 14:11:50 +02:00 committed by GitHub
parent e40286e04f
commit 4ec68db323
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 1 deletions

View File

@ -10,7 +10,6 @@ export interface NuxtError extends H3Error {}
export const showError = (_err: string | Error | Partial<NuxtError>) => {
const err = createError(_err)
err.fatal = true
try {
const nuxtApp = useNuxtApp()

View File

@ -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) {