Do not exit with error if local server is not running

This commit is contained in:
Dan Sosedoff 2018-12-18 18:11:56 -06:00
parent 9a3c79d93d
commit 9c07ac356b

View File

@ -80,12 +80,17 @@ func initClient() {
msg := err.Error()
// Check if we're trying to connect to the default database.
// If database does not exist, allow user to connect from the UI.
if command.Opts.DbName == "" {
// If database does not exist, allow user to connect from the UI.
if strings.Contains(msg, "database") && strings.Contains(msg, "does not exist") {
fmt.Println("Error:", msg)
return
}
// Do not bail if local server is not running.
if strings.Contains(msg, "connection refused") {
fmt.Println("Error:", msg)
return
}
}
exitWithMessage(msg)