mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-12 11:48:17 +00:00
fix(nuxt): suppress handled errors (#20002)
This commit is contained in:
parent
434e2013e4
commit
4ed5d2f872
@ -37,6 +37,7 @@ onErrorCaptured((err, target, info) => {
|
|||||||
if (process.server || (isNuxtError(err) && (err.fatal || err.unhandled))) {
|
if (process.server || (isNuxtError(err) && (err.fatal || err.unhandled))) {
|
||||||
const p = callWithNuxt(nuxtApp, showError, [err])
|
const p = callWithNuxt(nuxtApp, showError, [err])
|
||||||
onServerPrefetch(() => p)
|
onServerPrefetch(() => p)
|
||||||
|
return false // suppress error from breaking render
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -238,8 +238,9 @@ export function createNuxtApp (options: CreateOptions) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// Log errors captured when running plugins, in the `app:created` and `app:beforeMount` hooks
|
// Log errors captured when running plugins, in the `app:created` and `app:beforeMount` hooks
|
||||||
// as well as when mounting the app and in the `app:mounted` hook
|
// as well as when mounting the app.
|
||||||
nuxtApp.hook('app:error', (...args) => { console.error('[nuxt] error caught during app initialization', ...args) })
|
const unreg = nuxtApp.hook('app:error', (...args) => { console.error('[nuxt] error caught during app initialization', ...args) })
|
||||||
|
nuxtApp.hook('app:mounted', unreg)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Expose runtime config
|
// Expose runtime config
|
||||||
|
Loading…
Reference in New Issue
Block a user