From b1c74e9069c1d9858ce3b96f4bc9fdf9e910cd89 Mon Sep 17 00:00:00 2001 From: Azareal Date: Wed, 29 Aug 2018 12:22:09 +1000 Subject: [PATCH] Debugging Travis. --- query_gen/lib/mysql.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/query_gen/lib/mysql.go b/query_gen/lib/mysql.go index 8109cbaa..4015566c 100644 --- a/query_gen/lib/mysql.go +++ b/query_gen/lib/mysql.go @@ -41,6 +41,13 @@ func (adapter *MysqlAdapter) GetStmts() map[string]DBStmt { // TODO: Add an option to disable unix pipes func (adapter *MysqlAdapter) BuildConn(config map[string]string) (*sql.DB, error) { + // The adapter seems to be panicking when encountering a recoverable error x.x + defer func() { + if r := recover(); r != nil { + fmt.Println("Recovered in f", r) + } + }() + dbCollation, ok := config["collation"] if !ok { return nil, ErrNoCollation @@ -52,13 +59,6 @@ func (adapter *MysqlAdapter) BuildConn(config map[string]string) (*sql.DB, error // First try opening a pipe as those are faster if runtime.GOOS == "linux" { - // The adapter seems to be panicking when encountering a recoverable error x.x - defer func() { - if r := recover(); r != nil { - fmt.Println("Recovered in f", r) - } - }() - var dbsocket = "/tmp/mysql.sock" if config["socket"] != "" { dbsocket = config["socket"] @@ -68,6 +68,8 @@ func (adapter *MysqlAdapter) BuildConn(config map[string]string) (*sql.DB, error if err == nil { // Make sure that the connection is alive return db, db.Ping() + } else { + fmt.Println(err) } }