fix(nuxt)!: change statusCode type to number for error page template (#6010)

This commit is contained in:
Daniel Roe 2022-07-20 18:00:42 +01:00 committed by GitHub
parent bdbeb886ae
commit 92269dde44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,8 +29,8 @@ const stacktrace = (error.stack || '')
}).map(i => `<span class="stack${i.internal ? ' internal' : ''}">${i.text}</span>`).join('\n') }).map(i => `<span class="stack${i.internal ? ' internal' : ''}">${i.text}</span>`).join('\n')
// Error page props // Error page props
const statusCode = String(error.statusCode || 500) const statusCode = Number(error.statusCode || 500)
const is404 = statusCode === '404' const is404 = statusCode === 404
const statusMessage = error.statusMessage ?? (is404 ? 'Page Not Found' : 'Internal Server Error') const statusMessage = error.statusMessage ?? (is404 ? 'Page Not Found' : 'Internal Server Error')
const description = error.message || error.toString() const description = error.message || error.toString()