Fix startup behavior when user did not provide a database name
This commit is contained in:
parent
1189bdef33
commit
21d2893292
@ -77,7 +77,18 @@ func initClient() {
|
|||||||
fmt.Println("Connecting to server...")
|
fmt.Println("Connecting to server...")
|
||||||
err = cl.Test()
|
err = cl.Test()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
exitWithMessage(err.Error())
|
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 strings.Contains(msg, "database") && strings.Contains(msg, "does not exist") {
|
||||||
|
fmt.Println("Error:", msg)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
exitWithMessage(msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
if !command.Opts.Sessions {
|
if !command.Opts.Sessions {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user