fix error handling

close #464
This commit is contained in:
Yasuhiro Matsumoto 2017-09-28 12:40:27 +09:00
parent 68bcba68d9
commit 49f9543f14
1 changed files with 2 additions and 2 deletions

View File

@ -127,11 +127,11 @@ func TestShortTimeout(t *testing.T) {
FROM test_table
ORDER BY key2 ASC`
rows, err := db.QueryContext(ctx, query)
if err != nil {
if err != nil && context.DeadlineExceeded {
t.Fatal(err)
}
if ctx.Err() != nil && context.DeadlineExceeded != ctx.Err() {
t.Fatalf("%v", ctx.Err())
t.Fatalf(ctx.Err())
}
rows.Close()
}