mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 16:12:12 +00:00
refactor: log nuxtServerInit error for better error tracing
This commit is contained in:
parent
e5017c5e2a
commit
6b6aa3e392
@ -91,7 +91,12 @@ export default async ssrContext => {
|
|||||||
** Dispatch store nuxtServerInit
|
** Dispatch store nuxtServerInit
|
||||||
*/
|
*/
|
||||||
if (store._actions && store._actions.nuxtServerInit) {
|
if (store._actions && store._actions.nuxtServerInit) {
|
||||||
await store.dispatch('nuxtServerInit', app.context)
|
try {
|
||||||
|
await store.dispatch('nuxtServerInit', app.context)
|
||||||
|
} catch (err) {
|
||||||
|
debug('error occurred when calling nuxtServerInit: ', e.message)
|
||||||
|
throw err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// ...If there is a redirect or an error, stop the process
|
// ...If there is a redirect or an error, stop the process
|
||||||
if (ssrContext.redirected) return noopApp()
|
if (ssrContext.redirected) return noopApp()
|
||||||
|
Loading…
Reference in New Issue
Block a user