Skip to content

Commit

Permalink
fix: always exit 1 when error happens
Browse files Browse the repository at this point in the history
  • Loading branch information
geekdada committed Dec 25, 2020
1 parent c5222db commit 9c833ba
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions commandnew.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,8 @@ func (x *NewCommand) Run(args []string) (int, error) {
responseMessage, err := memo.Submit(x.Verbose)

if err != nil {
switch err.(type) {
case *client.ResponseError:
re, _ := err.(*client.ResponseError)

if re.StatusCode >= 400 && re.StatusCode < 500 {
return 2, err
} else {
return 1, err
}
default:
fmt.Println(err)
return 1, err
}
log.Println(err)
return 1, err
}

log.Println(*responseMessage)
Expand Down

0 comments on commit 9c833ba

Please sign in to comment.