Skip to content

Commit

Permalink
fix: Fix error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
ikawaha committed Jan 20, 2024
1 parent 7d428e3 commit 41d9614
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/lattice/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (o *option) parse(args []string) error {
}
// validations
if o.flagSet.NArg() == 0 {
return fmt.Errorf("input is empty")
return errors.New("no option is specified")
}
if o.dict != "" && o.dict != "ipa" && o.dict != "uni" {
return fmt.Errorf("invalid argument: -dict %v", o.dict)
Expand Down Expand Up @@ -153,7 +153,7 @@ func Run(ctx context.Context, args []string) error {
if err := opt.parse(args); err != nil {
Usage()
PrintDefaults(flag.ContinueOnError)
return errors.New("")
return err
}
return command(ctx, opt)
}
Expand Down

0 comments on commit 41d9614

Please sign in to comment.