fix: replace panic with os.Exit in Execute function for better error handling (#3702)
parent
d8b4b6b62a
commit
d21f6cd2bc
|
|
@ -69,9 +69,7 @@ func init() {
|
|||
// Execute root command.
|
||||
func Execute() {
|
||||
if err := rootCmd.Execute(); err != nil {
|
||||
if !errors.As(err, &flagError{}) {
|
||||
panic(err)
|
||||
}
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue