From 5a1172301bd5b9cb2c6c5d8acdd55de70169e87c Mon Sep 17 00:00:00 2001 From: Jeff Dickey <216188+jdxcode@users.noreply.github.com> Date: Fri, 19 Jan 2018 11:21:53 -0800 Subject: [PATCH] fix: always raise errors --- src/command.ts | 9 +++------ tsconfig.json | 1 + 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/command.ts b/src/command.ts index 98aed180..7bb92f53 100644 --- a/src/command.ts +++ b/src/command.ts @@ -73,13 +73,10 @@ export default abstract class Command { await this.run() await this.done() } catch (err) { - // throw HelpErr to allow the CLI to do something with it - switch (err.code) { - case 'EEXIT': break - case 'EHELP': throw err - default: - deps.cli.error(err) + if (this.config && this.config.engine) { + await this.config.engine.runHook('error', err) } + deps.cli.error(err) } return this } diff --git a/tsconfig.json b/tsconfig.json index c6ce09c7..4dfabdef 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,6 +10,7 @@ "rootDir": "./src", "strict": true, "strictFunctionTypes": false, + "sourceMap": true, "target": "es2017" }, "include": [