Skip to content

Commit

Permalink
Merge pull request #399 from sosedoff/fix-start-with-default-db
Browse files Browse the repository at this point in the history
Do not exit with error if local server is not running
  • Loading branch information
sosedoff authored Dec 19, 2018
2 parents 9a3c79d + 9c07ac3 commit aadee6a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit aadee6a

Please sign in to comment.