mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-17 06:01:34 +00:00
fix(vue-app): Call Vue.config.errorHandler instead of simply logging the error
This commit is contained in:
parent
59aee74a88
commit
6c4280f87f
@ -69,14 +69,14 @@ if (!Vue.config.$nuxt) {
|
|||||||
Vue.config.$nuxt = {}
|
Vue.config.$nuxt = {}
|
||||||
}
|
}
|
||||||
Vue.config.$nuxt.<%= globals.nuxt %> = true
|
Vue.config.$nuxt.<%= globals.nuxt %> = true
|
||||||
|
|
||||||
<% } %>
|
<% } %>
|
||||||
|
|
||||||
// Create and mount App
|
// Create and mount App
|
||||||
createApp()
|
createApp()
|
||||||
.then(mountApp)
|
.then(mountApp)
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.error('[nuxt] Error while initializing app', err)
|
err.message = '[nuxt] Error while mounting app: ' + err.message
|
||||||
|
Vue.config.errorHandler(err)
|
||||||
})
|
})
|
||||||
|
|
||||||
function componentOption(component, key, ...args) {
|
function componentOption(component, key, ...args) {
|
||||||
@ -674,7 +674,7 @@ async function mountApp(__app) {
|
|||||||
// Push the path and then mount app
|
// Push the path and then mount app
|
||||||
router.push(path, () => mount(), (err) => {
|
router.push(path, () => mount(), (err) => {
|
||||||
if (!err) return mount()
|
if (!err) return mount()
|
||||||
console.error(err)
|
Vue.config.errorHandler(err)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user