Do not exit with error if local server is not running
This commit is contained in:
parent
9a3c79d93d
commit
9c07ac356b
@ -80,12 +80,17 @@ func initClient() {
|
|||||||
msg := err.Error()
|
msg := err.Error()
|
||||||
|
|
||||||
// Check if we're trying to connect to the default database.
|
// 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 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") {
|
if strings.Contains(msg, "database") && strings.Contains(msg, "does not exist") {
|
||||||
fmt.Println("Error:", msg)
|
fmt.Println("Error:", msg)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
// Do not bail if local server is not running.
|
||||||
|
if strings.Contains(msg, "connection refused") {
|
||||||
|
fmt.Println("Error:", msg)
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
exitWithMessage(msg)
|
exitWithMessage(msg)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user