Merge pull request #2070 from clarkdo/nuxtserverinit_error

refactor: log nuxtServerInit error for better error tracing
This commit is contained in:
Sébastien Chopin 2017-11-10 08:31:29 +01:00 committed by GitHub
commit 0198a184b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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()