-
Notifications
You must be signed in to change notification settings - Fork 437
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
contrib/database/sql: Add WithErrorCheck options #1315
contrib/database/sql: Add WithErrorCheck options #1315
Conversation
WithErrorCheck specifies a function fn which determines whether the passed error should be marked as an error. The fn is called whenever a database/sql operation finishes with an error. close DataDog#1314
c70478d
to
be59f6b
Compare
Co-authored-by: Gabriel Aszalos <gabriel.aszalos@gmail.com>
Co-authored-by: Gabriel Aszalos <gabriel.aszalos@gmail.com>
Co-authored-by: Gabriel Aszalos <gabriel.aszalos@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, last comment, promise! 🤞🏻
Co-authored-by: Gabriel Aszalos <gabriel.aszalos@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! LGTM! Thanks for your patience!
how about ? @gbbr @katiehockman |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Sorry for the delay
@gbbr @katiehockman merged main branch. please re-review it. or can i help something to merge it ? |
thanks ! |
WithErrorCheck specifies a function fn which determines whether the passed
error should be marked as an error. The fn is called whenever a database/sql operation
finishes with an error.
close #1314
Almost base code is taken from #806.
I think it is good to check err as not nil before call
errCheck
. User maybe don't expect to pass nil error toWithErrorCheck
. How do you think ?