mirror of
https://github.com/jackc/pgx.git
synced 2025-05-28 10:12:08 +00:00
TestFatalRxError expects multiple error types
This commit is contained in:
parent
9edd770c70
commit
129ff96567
@ -1214,8 +1214,10 @@ func TestFatalRxError(t *testing.T) {
|
||||
var n int32
|
||||
var s string
|
||||
err := conn.QueryRow("select 1::int4, pg_sleep(10)::varchar").Scan(&n, &s)
|
||||
if pgErr, ok := err.(pgx.PgError); !ok || pgErr.Severity != "FATAL" {
|
||||
t.Fatalf("Expected QueryRow Scan to return fatal PgError, but instead received %v", err)
|
||||
if err == pgx.ErrDeadConn {
|
||||
} else if pgErr, ok := err.(pgx.PgError); ok && pgErr.Severity == "FATAL" {
|
||||
} else {
|
||||
t.Fatalf("Expected QueryRow Scan to return fatal PgError or ErrDeadConn, but instead received %v", err)
|
||||
}
|
||||
}()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user