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.
|
// Execute root command.
|
||||||
func Execute() {
|
func Execute() {
|
||||||
if err := rootCmd.Execute(); err != nil {
|
if err := rootCmd.Execute(); err != nil {
|
||||||
if !errors.As(err, &flagError{}) {
|
os.Exit(1)
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue