mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
Improve error page when throwing exception
This commit is contained in:
parent
f8735dc450
commit
0d7e0ca8a8
@ -134,9 +134,12 @@ export default context => {
|
||||
return _app
|
||||
})
|
||||
.catch(function (error) {
|
||||
if (error && error instanceof Error) {
|
||||
if (error && (error instanceof Error || error.constructor.toString().indexOf('Error()') !== -1)) {
|
||||
error = { statusCode: 500, message: error.message }
|
||||
}
|
||||
else if (typeof error === 'string') {
|
||||
error = { statusCode: 500, message: error }
|
||||
}
|
||||
context.nuxt.error = context.error(error)
|
||||
<%= (store ? 'context.nuxt.state = store.state' : '') %>
|
||||
return _app
|
||||
|
Loading…
Reference in New Issue
Block a user