This is an automated email from the ASF dual-hosted git repository.

jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-newt.git


The following commit(s) were added to refs/heads/master by this push:
     new 1686c678 Don't panic in case of other error types in NewtUsage
1686c678 is described below

commit 1686c67862d9c13a433f1ae11979dc5b0043832a
Author: Michal Gorecki <michal.gore...@codecoup.pl>
AuthorDate: Mon Apr 15 16:48:08 2024 +0200

    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 75f60282..ccbb0bc4 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())

Reply via email to