From 9c07ac356b95628ae9447edd1d719b0ae232c29e Mon Sep 17 00:00:00 2001 From: Dan Sosedoff Date: Tue, 18 Dec 2018 18:11:56 -0600 Subject: [PATCH] Do not exit with error if local server is not running --- pkg/cli/cli.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/cli/cli.go b/pkg/cli/cli.go index 8785154..7345e0a 100644 --- a/pkg/cli/cli.go +++ b/pkg/cli/cli.go @@ -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)