feat: added errorMiddleware hook. (#2703)

This commit is contained in:
Diederik van den Burger 2018-01-27 16:12:30 +01:00 committed by Pooya Parsa
parent 4811ddd6b9
commit 7bea248fe4

View File

@ -280,6 +280,11 @@ module.exports = class Renderer {
// Error middleware for errors that occurred in middleware that declared above
// Middleware should exactly take 4 arguments
// https://github.com/senchalabs/connect#error-middleware
// Apply errorMiddleware from modules first
await this.nuxt.callHook('render:errorMiddleware', this.app)
// Apply errorMiddleware from Nuxt
this.useMiddleware(errorMiddleware.bind(this))
}