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
1 changed files with 3 additions and 0 deletions

View File

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