Commit 449f34ed authored by Eric Chiang's avatar Eric Chiang

storage/sql: print error before calling t.Fatal

parent 4296604f
......@@ -72,15 +72,20 @@ func TestPostgres(t *testing.T) {
},
ConnectionTimeout: 5,
}
conn, err := p.open()
if err != nil {
t.Fatal(err)
// t.Fatal has a bad habbit of not actually printing the error
fatal := func(i interface{}) {
fmt.Fprintln(os.Stdout, i)
t.Fatal(i)
}
defer conn.Close()
newStorage := func() storage.Storage {
conn, err := p.open()
if err != nil {
fatal(err)
}
if err := cleanDB(conn); err != nil {
t.Fatal(err)
fatal(err)
}
return conn
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment