mirror of
https://github.com/sosedoff/pgweb.git
synced 2024-12-14 19:21:46 +03:00
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()
|
||||
|
||||
// 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)
|
||||
|
Loading…
Reference in New Issue
Block a user