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

😵 Add new error type for failed SQL queries #457

Merged
merged 1 commit into from
Jul 9, 2021
Merged

Conversation

rowanseymour
Copy link
Contributor

My cunning plan to get failing SQL queries into sentry didn't work very well because sentry trims the error message to 200 chars, so after all the wrapping you only get a few chars of SQL. This PR adds a new error type which can be used to attach SQL and args to the logrus entry as field data.

@codecov
Copy link

codecov bot commented Jul 8, 2021

Codecov Report

Merging #457 (96970fe) into main (a4da43b) will increase coverage by 0.07%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #457      +/-   ##
==========================================
+ Coverage   56.49%   56.56%   +0.07%     
==========================================
  Files         123      123              
  Lines        8566     8581      +15     
==========================================
+ Hits         4839     4854      +15     
  Misses       2950     2950              
  Partials      777      777              
Impacted Files Coverage Δ
core/tasks/handler/worker.go 50.47% <100.00%> (+0.23%) ⬆️
utils/dbutil/errors.go 100.00% <100.00%> (ø)
utils/dbutil/query.go 67.30% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a4da43b...96970fe. Read the comment docs.

@rowanseymour rowanseymour requested a review from nicpottier July 8, 2021 19:57
Copy link
Member

@nicpottier nicpottier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, neat if it works!

@rowanseymour rowanseymour merged commit 819300f into main Jul 9, 2021
@rowanseymour rowanseymour deleted the query_errors branch July 9, 2021 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants