fix(nuxt): log more context of prerendering errors (#28895)

This commit is contained in:
Daniel Roe 2024-09-09 15:30:11 +02:00
parent 3f508d521f
commit a9385d04b4
No known key found for this signature in database
GPG Key ID: 3714AB03996F442B

View File

@ -33,7 +33,7 @@ export default <NitroErrorHandler> async function errorhandler (error: H3Error,
error.fatal && '[fatal]', error.fatal && '[fatal]',
Number(errorObject.statusCode) !== 200 && `[${errorObject.statusCode}]`, Number(errorObject.statusCode) !== 200 && `[${errorObject.statusCode}]`,
].filter(Boolean).join(' ') ].filter(Boolean).join(' ')
console.error(tags, errorObject.message + '\n' + stack.map(l => ' ' + l.text).join(' \n')) console.error(tags, (error.message || error.toString() || 'internal server error') + '\n' + stack.map(l => ' ' + l.text).join(' \n'))
} }
if (event.handled) { return } if (event.handled) { return }