Skip to content

Commit fcd8d19

Browse files
author
Juhyung Park
committed
Show invalid action error first
1 parent e7b9980 commit fcd8d19

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ async function main(action: string, option: Option) {
4444
}
4545
const cckey = await CCKey.create({});
4646
try {
47+
if (!_.includes(actions, action)) {
48+
throw new CLIError(CLIErrorType.InvalidAction);
49+
}
4750
const accountType = getOpt(option, "account-type") as AccountType;
4851
if (!_.includes(["platform", "asset"], accountType)) {
4952
throw new CLIError(CLIErrorType.InvalidAccountType);
5053
}
51-
if (!_.includes(actions, action)) {
52-
throw new CLIError(CLIErrorType.InvalidAction);
53-
}
5454

5555
switch (action) {
5656
case "getKeys":

0 commit comments

Comments
 (0)