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

Commit

Permalink
fix: use CLIError when command is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Feb 6, 2018
1 parent 4e74cfe commit ef0a6ac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit ef0a6ac

Please sign in to comment.