From d78ae9aa7cc6293891af7997034ca9c410f8b53e Mon Sep 17 00:00:00 2001 From: Michal Gorecki Date: Mon, 15 Apr 2024 16:48:08 +0200 Subject: [PATCH] Don't panic in case of other error types in NewtUsage It does not make sense to panic before printing error --- newt/cli/util.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/newt/cli/util.go b/newt/cli/util.go index 75f60282f..ccbb0bc47 100644 --- a/newt/cli/util.go +++ b/newt/cli/util.go @@ -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())