mirror of https://github.com/jackc/pgx.git
pgconn: normalize starTLS connection error
Normalize the error that is returned by startTLS in pgconn.connect. This makes it possible to determine if the error was a context error.pull/1837/head
parent
df3c5f4df8
commit
2daeb8dc5f
pgconn
|
@ -295,7 +295,7 @@ func connect(ctx context.Context, config *Config, fallbackConfig *FallbackConfig
|
|||
pgConn.contextWatcher.Unwatch() // Always unwatch `netConn` after TLS.
|
||||
if err != nil {
|
||||
netConn.Close()
|
||||
return nil, &connectError{config: config, msg: "tls error", err: err}
|
||||
return nil, &connectError{config: config, msg: "tls error", err: normalizeTimeoutError(ctx, err)}
|
||||
}
|
||||
|
||||
pgConn.conn = nbTLSConn
|
||||
|
|
Loading…
Reference in New Issue