1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-20 05:39:42 +02:00

Bump version to 5.11.0

This commit is contained in:
Harvey Kandola 2024-01-10 14:47:40 -05:00
parent a32510b8e6
commit 510e1bd0bd
370 changed files with 18825 additions and 5454 deletions

19
vendor/github.com/lib/pq/error.go generated vendored
View file

@ -402,6 +402,11 @@ func (err *Error) Fatal() bool {
return err.Severity == Efatal
}
// SQLState returns the SQLState of the error.
func (err *Error) SQLState() string {
return string(err.Code)
}
// Get implements the legacy PGError interface. New code should use the fields
// of the Error struct directly.
func (err *Error) Get(k byte) (v string) {
@ -444,7 +449,7 @@ func (err *Error) Get(k byte) (v string) {
return ""
}
func (err Error) Error() string {
func (err *Error) Error() string {
return "pq: " + err.Message
}
@ -484,7 +489,7 @@ func (cn *conn) errRecover(err *error) {
case nil:
// Do nothing
case runtime.Error:
cn.setBad()
cn.err.set(driver.ErrBadConn)
panic(v)
case *Error:
if v.Fatal() {
@ -493,26 +498,26 @@ func (cn *conn) errRecover(err *error) {
*err = v
}
case *net.OpError:
cn.setBad()
cn.err.set(driver.ErrBadConn)
*err = v
case *safeRetryError:
cn.setBad()
cn.err.set(driver.ErrBadConn)
*err = driver.ErrBadConn
case error:
if v == io.EOF || v.(error).Error() == "remote error: handshake failure" {
if v == io.EOF || v.Error() == "remote error: handshake failure" {
*err = driver.ErrBadConn
} else {
*err = v
}
default:
cn.setBad()
cn.err.set(driver.ErrBadConn)
panic(fmt.Sprintf("unknown error: %#v", e))
}
// Any time we return ErrBadConn, we need to remember it since *Tx doesn't
// mark the connection bad in database/sql.
if *err == driver.ErrBadConn {
cn.setBad()
cn.err.set(driver.ErrBadConn)
}
}