add title for spa error handler

This commit is contained in:
Pooya Parsa 2017-08-05 16:40:47 +04:30
parent 769c1100b6
commit e70d0ba7d0

View File

@ -31,6 +31,8 @@ NUXT.components = window.__COMPONENTS__ || null
// Setup global Vue error handler
const defaultErrorHandler = Vue.config.errorHandler
Vue.config.errorHandler = function (err, vm, info) {
err.statusCode = err.statusCode || 'Whoops!'
// Show Nuxt Error Page
if(vm && vm.$root && vm.$root.$nuxt) {
vm.$root.$nuxt.error(err)