mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-30 23:32:38 +00:00
parent
5f50d402d5
commit
1ab4be456f
@ -226,11 +226,11 @@ async function render (to, from, next) {
|
||||
if (!Components.length) {
|
||||
// Default layout
|
||||
await callMiddleware.call(this, Components, app.context)
|
||||
if (app.context._redirected) return
|
||||
if (nextCalled) return
|
||||
// Load layout for error page
|
||||
const layout = await this.loadLayout(typeof NuxtError.layout === 'function' ? NuxtError.layout(app.context) : NuxtError.layout)
|
||||
await callMiddleware.call(this, Components, app.context, layout)
|
||||
if (app.context._redirected) return
|
||||
if (nextCalled) return
|
||||
// Show error page
|
||||
app.context.error({ statusCode: 404, message: '<%= messages.error_404 %>' })
|
||||
return next()
|
||||
@ -250,7 +250,7 @@ async function render (to, from, next) {
|
||||
try {
|
||||
// Call middleware
|
||||
await callMiddleware.call(this, Components, app.context)
|
||||
if (app.context._redirected) return
|
||||
if (nextCalled) return
|
||||
if (app.context._errored) return next()
|
||||
|
||||
// Set layout
|
||||
@ -262,7 +262,7 @@ async function render (to, from, next) {
|
||||
|
||||
// Call middleware for layout
|
||||
await callMiddleware.call(this, Components, app.context, layout)
|
||||
if (app.context._redirected) return
|
||||
if (nextCalled) return
|
||||
if (app.context._errored) return next()
|
||||
|
||||
// Call .validate()
|
||||
|
Loading…
Reference in New Issue
Block a user