summaryrefslogtreecommitdiff
path: root/vendor/github.com/jackc/pgx/v5/pgconn/errors.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/jackc/pgx/v5/pgconn/errors.go')
-rw-r--r--vendor/github.com/jackc/pgx/v5/pgconn/errors.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/vendor/github.com/jackc/pgx/v5/pgconn/errors.go b/vendor/github.com/jackc/pgx/v5/pgconn/errors.go
index ec4a6d47c..d968d3f03 100644
--- a/vendor/github.com/jackc/pgx/v5/pgconn/errors.go
+++ b/vendor/github.com/jackc/pgx/v5/pgconn/errors.go
@@ -27,7 +27,7 @@ func Timeout(err error) bool {
}
// PgError represents an error reported by the PostgreSQL server. See
-// http://www.postgresql.org/docs/11/static/protocol-error-fields.html for
+// http://www.postgresql.org/docs/current/static/protocol-error-fields.html for
// detailed field description.
type PgError struct {
Severity string
@@ -112,6 +112,14 @@ type ParseConfigError struct {
err error
}
+func NewParseConfigError(conn, msg string, err error) error {
+ return &ParseConfigError{
+ ConnString: conn,
+ msg: msg,
+ err: err,
+ }
+}
+
func (e *ParseConfigError) Error() string {
// Now that ParseConfigError is public and ConnString is available to the developer, perhaps it would be better only
// return a static string. That would ensure that the error message cannot leak a password. The ConnString field would