Skip to content

Commit d3b211d

Browse files
committed
Add better error when viper fails first time in hoverctl
1 parent 1eb0280 commit d3b211d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

hoverctl/configuration/config.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ type Config struct {
1919
func GetConfig() *Config {
2020
err := viper.ReadInConfig()
2121
if err != nil {
22-
log.Debug(err.Error())
22+
log.Debug("Error reading config")
23+
if err.Error() == `Unsupported Config Type ""` {
24+
log.Debug("viper not properly configured, if this is the first time executing hoverctl, please try te command again")
25+
} else {
26+
log.Debug(err.Error())
27+
}
2328
}
2429

2530
return &Config{

0 commit comments

Comments
 (0)