Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

database/sql: error not wrapped #44635

eduardisimo203 opened this issue Feb 26, 2021 · 2 comments

database/sql: error not wrapped #44635

eduardisimo203 opened this issue Feb 26, 2021 · 2 comments


Copy link

@eduardisimo203 eduardisimo203 commented Feb 26, 2021

What version of Go are you using (go version)?

$ go version
go version go1.16 darwin/amd64

Does this issue reproduce with the latest release?


What operating system and processor architecture are you using (go env)?

go env Output
$ go env


What did you do?

Happened to use one of the SQL Exec methods and happened to get error at

return nil, fmt.Errorf("sql: converting argument %s type: %v", describeNamedValue(nv), err)

The error does not get wrapped (with "%w"), so cannot use errors.Is()

What did you expect to see?

What did you see instead?

@seankhliao seankhliao changed the title SQL error does not wrap an error sql: error not wrapped Feb 26, 2021
Copy link

@seankhliao seankhliao commented Feb 26, 2021

Which errors would this allow comparing to? And what would the calling code do differently when it can inspect the error?

@ianlancetaylor ianlancetaylor changed the title sql: error not wrapped database/sql: error not wrapped Feb 26, 2021
Copy link

@eduardisimo203 eduardisimo203 commented Feb 26, 2021

I believe the error is returned by our custom Scan(src interface{}) error method. And when we try to see if that error occurred, it, of course, fails because it's not wrapped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants