9 Commits

Author SHA1 Message Date
Jack Christensen
cf5894e092 Use std errors instead of golang.org/x/xerrors
New error functionality was introduced in Go 1.13. pgconn only
officially supports 1.15+. Transitional xerrors package can now be
removed.
2021-03-06 14:45:33 -06:00
ip.novikov
e0d22c1100 improve regexp
get shortest sequence between : and @
2020-12-05 22:11:52 +03:00
ip.novikov
a581247a12 Add check for url with broken password
replace broken password in parseConfigError message
2020-12-05 15:28:01 +03:00
Jack Christensen
416f037e77 Fix docs for Timeout 2020-10-05 19:39:05 -05:00
Lukas Vogel
f27e874d55 redact passwords in parse config errors
Redact passwords when printing the parseConfigError in a best effort manner.
This prevents people from leaking the password into logs, if they just print the error in logs.
2020-06-12 13:01:57 +02:00
Jack Christensen
b6669ae6dd Add PgError.SQLState method
fixes #15
2020-01-11 18:23:41 -06:00
Jack Christensen
138254da5b Refactor errors
- Use strongly typed errors internally
- SafeToRetry(error) streamlines retry logic over ErrNoBytesSent
- Timeout(error) removes the need to choose between returning a context
  and an i/o error
2019-08-27 18:05:50 -05:00
Jack Christensen
7e0022ef6b Tag errors if no bytes sent to server 2019-04-20 16:48:24 -05:00
Jack Christensen
0f8e1d30e2 Link context errors and underlying conn errors
Using golang.org/x/xerrors type errors both errors can be exposed.
2019-04-20 15:53:30 -05:00