From ef0a6ac5d70ffb5f41bcc3d9b069a9d8d74c02ef Mon Sep 17 00:00:00 2001 From: Jeff Dickey <216188+jdxcode@users.noreply.github.com> Date: Mon, 5 Feb 2018 19:45:05 -0800 Subject: [PATCH] fix: use CLIError when command is not found --- src/plugin.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugin.ts b/src/plugin.ts index e8fca0a1..5a06b212 100644 --- a/src/plugin.ts +++ b/src/plugin.ts @@ -162,7 +162,7 @@ export class Plugin implements IPlugin { let command = plugin.findCommand(id) if (command) return command } - if (opts.must) throw new Error(`command ${id} not found`) + if (opts.must) throw new CLIError(`command ${id} not found`) } findTopic(id: string, opts: {must: true}): Topic @@ -258,7 +258,7 @@ export class Plugin implements IPlugin { return cmd } const cmd = fetch() - if (!cmd && opts.must) throw new Error(`command ${id} not found`) + if (!cmd && opts.must) throw new CLIError(`command ${id} not found`) return cmd }