mirror of
https://github.com/status-im/consul.git
synced 2025-02-16 15:47:21 +00:00
Handle error from stat on data-dir and shorten error message
This commit is contained in:
parent
8daa45c5b4
commit
daa5ba87d4
@ -209,10 +209,12 @@ func (c *Command) readConfig() *Config {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if finfo, _ := os.Stat(config.DataDir); !finfo.IsDir() {
|
if finfo, err := os.Stat(config.DataDir); err != nil {
|
||||||
c.Ui.Error(fmt.Sprintf("CRITICAL: The data-dir specified at %q is not a directory", config.DataDir))
|
c.Ui.Error(fmt.Sprintf("Error getting data-dir: %s", err))
|
||||||
c.Ui.Error("Consul will refuse to boot without a valid data directory")
|
return nil
|
||||||
c.Ui.Error("Please provide a valid directory and try starting again.")
|
} else if !finfo.IsDir() {
|
||||||
|
c.Ui.Error(fmt.Sprintf("The data-dir specified at %q is not a directory", config.DataDir))
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure all endpoints are unique
|
// Ensure all endpoints are unique
|
||||||
|
Loading…
x
Reference in New Issue
Block a user