Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Failed connection attempts include all errors
A single Connect("connstring") may actually make multiple connection requests due to TLS or HA configuration. Previously, when all attempts failed only the last error was returned. This could be confusing. Now details of all failed attempts are included. For example, the following connection string: host=localhost,127.0.0.1,foo.invalid port=1,2,3 Will now return an error like the following: failed to connect to `user=postgres database=pgx_test`: lookup foo.invalid: no such host [::1]:1 (localhost): dial error: dial tcp [::1]:1: connect: connection refused 127.0.0.1:1 (localhost): dial error: dial tcp 127.0.0.1:1: connect: connection refused 127.0.0.1:2 (127.0.0.1): dial error: dial tcp 127.0.0.1:2: connect: connection refused #1929
- Loading branch information