Add debug for redirect on ssr

This commit is contained in:
Sébastien Chopin 2017-03-26 23:38:51 +02:00
parent d63b34de78
commit 2f2eaac299
2 changed files with 8 additions and 0 deletions

View File

@ -59,6 +59,10 @@ export default context => {
Component._Ctor = Component
Component.extendOptions = Component.options
}
// For debugging purpose
if (!Component.options.name && Component.options.__file) {
Component.options.name = Component.options.__file
}
resolve(Component)
}
Component().then(_resolve).catch(reject)

View File

@ -71,6 +71,10 @@ export function render (req, res) {
return html
})
.catch((err) => {
if (context.redirected) {
console.error(err) // eslint-disable-line no-console
return err
}
const html = this.errorTemplate({
error: err,
stack: ansiHTML(encodeHtml(err.stack))