Skip to content

Commit

Permalink
Don't panic in case of other error types in NewtUsage
Browse files Browse the repository at this point in the history
It does not make sense to panic before printing error
  • Loading branch information
m-gorecki committed Apr 15, 2024
1 parent cb6f87f commit d78ae9a
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions newt/cli/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ func NewtUsage(cmd *cobra.Command, err error) {
log.Debugf("%+v", err)
} else if ne, ok := err.(*util.NewtError); ok {
log.Debugf("%s", ne.StackTrace)
} else {
panic(fmt.Sprintf("unexpected error type: %T", err))
}

fmt.Fprintf(os.Stderr, "Error: %s\n", err.Error())
Expand Down

0 comments on commit d78ae9a

Please sign in to comment.