aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/lib/pq/error.go
diff options
context:
space:
mode:
authorGibheer <gibheer+git@zero-knowledge.org>2022-11-11 11:22:50 +0100
committerGibheer <gibheer+git@zero-knowledge.org>2022-11-11 11:22:50 +0100
commitfe6bd04947e26a962fab3cf7a354abd44333bda6 (patch)
treede4714364747c05d391ab665176413eb24938545 /vendor/github.com/lib/pq/error.go
parentdc9dfb76ff9375e6368e9e05a40e6dc07b325a8d (diff)
update dependencies
Diffstat (limited to 'vendor/github.com/lib/pq/error.go')
-rw-r--r--vendor/github.com/lib/pq/error.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/vendor/github.com/lib/pq/error.go b/vendor/github.com/lib/pq/error.go
index 5cfe9c6..f67c5a5 100644
--- a/vendor/github.com/lib/pq/error.go
+++ b/vendor/github.com/lib/pq/error.go
@@ -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
}