aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/github.com/lib/pq/error.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/lib/pq/error.go')
-rw-r--r--vendor/github.com/lib/pq/error.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/vendor/github.com/lib/pq/error.go b/vendor/github.com/lib/pq/error.go
index b4bb44c..96aae29 100644
--- a/vendor/github.com/lib/pq/error.go
+++ b/vendor/github.com/lib/pq/error.go
@@ -153,6 +153,7 @@ var errorCodeNames = map[ErrorCode]string{
"22004": "null_value_not_allowed",
"22002": "null_value_no_indicator_parameter",
"22003": "numeric_value_out_of_range",
+ "2200H": "sequence_generator_limit_exceeded",
"22026": "string_data_length_mismatch",
"22001": "string_data_right_truncation",
"22011": "substring_error",
@@ -459,6 +460,11 @@ func errorf(s string, args ...interface{}) {
panic(fmt.Errorf("pq: %s", fmt.Sprintf(s, args...)))
}
+// TODO(ainar-g) Rename to errorf after removing panics.
+func fmterrorf(s string, args ...interface{}) error {
+ return fmt.Errorf("pq: %s", fmt.Sprintf(s, args...))
+}
+
func errRecoverNoErrBadConn(err *error) {
e := recover()
if e == nil {
@@ -487,7 +493,8 @@ func (c *conn) errRecover(err *error) {
*err = v
}
case *net.OpError:
- *err = driver.ErrBadConn
+ c.bad = true
+ *err = v
case error:
if v == io.EOF || v.(error).Error() == "remote error: handshake failure" {
*err = driver.ErrBadConn