Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

Commit

Permalink
fix: trap hook error
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Jan 28, 2018
1 parent 01b873b commit a0f770c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,11 @@ export default abstract class Command {
} catch (err) {
if (err.code === 'EEXIT') throw err
if (this.config && this.config.engine) {
await this.config.engine.runHook('error', err)
try {
await this.config.engine.runHook('error', err)
} catch (err) {
cli.warn(err, {context: {description: 'error running hook'}})
}
}
cli.error(err)
}
Expand Down

0 comments on commit a0f770c

Please sign in to comment.