mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-30 23:32:38 +00:00
hook: Handle hook error and continue process
This commit is contained in:
parent
ad59f788dc
commit
daaa5bdd12
@ -64,7 +64,13 @@ export default class Nuxt {
|
||||
if (!this._hooks[name]) {
|
||||
return
|
||||
}
|
||||
debug(`Call ${name} hooks (${this._hooks[name].length})`)
|
||||
try {
|
||||
await sequence(this._hooks[name], (fn) => fn(...args))
|
||||
} catch (err) {
|
||||
console.error(`> Error on hook "${name}":`) // eslint-disable-line no-console
|
||||
console.error(err) // eslint-disable-line no-console
|
||||
}
|
||||
}
|
||||
|
||||
listen(port = 3000, host = 'localhost') {
|
||||
|
Loading…
Reference in New Issue
Block a user