Skip to content

Commit

Permalink
chore: use usageError in more places
Browse files Browse the repository at this point in the history
  • Loading branch information
lukekarrys committed Nov 3, 2021
1 parent 8ffeb71 commit c6717c7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/commands/cache.js
Expand Up @@ -116,7 +116,7 @@ class Cache extends BaseCommand {
case 'ls':
return await this.ls(args)
default:
throw Object.assign(new Error(this.usage), { code: 'EUSAGE' })
throw this.usageError(this.usage)
}
}

Expand Down Expand Up @@ -168,7 +168,7 @@ class Cache extends BaseCommand {
' npm cache add <folder>...\n'
log.silly('cache add', 'args', args)
if (args.length === 0)
throw Object.assign(new Error(usage), { code: 'EUSAGE' })
throw this.usageError(usage)

return Promise.all(args.map(spec => {
log.silly('cache add', 'spec', spec)
Expand Down

0 comments on commit c6717c7

Please sign in to comment.