Clarify error reporting in TestConnQueryErrorWhileReturningRows

pull/640/head
Adam Pantel 2019-11-22 11:03:08 -05:00
parent 0a3cfab73e
commit f989008ad5
1 changed files with 5 additions and 3 deletions

View File

@ -549,11 +549,13 @@ func TestConnQueryErrorWhileReturningRows(t *testing.T) {
for rows.Next() {
var n int32
rows.Scan(&n)
if err := rows.Scan(&n); err != nil {
t.Fatalf("Row scan failed: %v", err)
}
}
if err, ok := rows.Err().(*pgconn.PgError); !ok {
t.Fatalf("Expected pgx.PgError, got %v", err)
if _, ok := rows.Err().(*pgconn.PgError); !ok {
t.Fatalf("Expected pgx.PgError, got %v", rows.Err())
}
ensureConnValid(t, conn)