mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 23:22:02 +00:00
fix(nuxt): do not log 404
and showError
as fatal by default (#6437)
This commit is contained in:
parent
e40286e04f
commit
4ec68db323
@ -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()
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user