Improve error handling when string

This commit is contained in:
Sébastien Chopin 2017-01-26 15:21:39 +01:00
parent 4cbd6d6a28
commit 615bcae90c

View File

@ -68,6 +68,9 @@ const app = {
err: null, err: null,
error (err) { error (err) {
err = err || null err = err || null
if (typeof err === 'string') {
err = { statusCode: 500, message: err }
}
this.$options._nuxt.err = err; this.$options._nuxt.err = err;
return err return err
} }