From a0f770ce3863a449bdbfac98201f48c404c5968d Mon Sep 17 00:00:00 2001 From: Jeff Dickey <216188+jdxcode@users.noreply.github.com> Date: Sun, 28 Jan 2018 12:06:22 -0800 Subject: [PATCH] fix: trap hook error --- src/command.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/command.ts b/src/command.ts index 8e5b4220..161a6e5a 100644 --- a/src/command.ts +++ b/src/command.ts @@ -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) }