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

contrib/database/sql: Add WithErrorCheck option #1314

Closed
soh335 opened this issue Jun 1, 2022 · 2 comments · Fixed by #1315
Closed

contrib/database/sql: Add WithErrorCheck option #1314

soh335 opened this issue Jun 1, 2022 · 2 comments · Fixed by #1315
Labels
proposal/accepted Accepted proposals

Comments

@soh335
Copy link
Contributor

soh335 commented Jun 1, 2022

Hi, it is same feature with #805.
Sometime, we need to ignore specific error from contrib/database/sql.

In our case, need to ignore insert error like that Error 1062: Duplicate entry 'xxx' for key 'PRIMARY'.

So need WithErrorCheck option. How about ?

soh335 added a commit to soh335/dd-trace-go that referenced this issue Jun 1, 2022
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
soh335 added a commit to soh335/dd-trace-go that referenced this issue Jun 2, 2022
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
soh335 added a commit to soh335/dd-trace-go that referenced this issue Jun 2, 2022
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
soh335 added a commit to soh335/dd-trace-go that referenced this issue Jun 2, 2022
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
@gbbr
Copy link
Contributor

gbbr commented Jun 2, 2022

Fine by me!

@gbbr gbbr added the proposal/accepted Accepted proposals label Jun 2, 2022
@soh335
Copy link
Contributor Author

soh335 commented Jun 2, 2022

@gbbr Thank you for quick response. Ready to review p-r #1315 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal/accepted Accepted proposals
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants