Handle db open timeout err
This commit is contained in:
parent
dad48f0d3a
commit
81daf19175
1 changed files with 6 additions and 1 deletions
7
main.go
7
main.go
|
@ -9,6 +9,7 @@ import (
|
|||
"cli-go/utils/constants"
|
||||
"fmt"
|
||||
"log"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
@ -22,7 +23,11 @@ func main() {
|
|||
}
|
||||
db, err := pkg.GetDB(fmt.Sprintf("%sente-cli.db", cliDBPath))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
if strings.Contains(err.Error(), "timeout") {
|
||||
log.Fatalf("Please close all other instances of the cli and try again\n%v\n", err)
|
||||
} else {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
ctrl := pkg.ClICtrl{
|
||||
Client: api.NewClient(api.Params{
|
||||
|
|
Loading…
Reference in a new issue