Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
fix(nuxt): do not log 404 and showError as fatal by default
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Aug 8, 2022
1 parent e3b0608 commit 334b86e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 0 additions & 1 deletion packages/nuxt/src/app/composables/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 1 addition & 0 deletions packages/nuxt/src/pages/runtime/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 334b86e

Please sign in to comment.