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

chore: use errors.Is to check for a specific error #2483

Merged
merged 2 commits into from
Jan 4, 2023

Conversation

Fish-pro
Copy link
Contributor

@Fish-pro Fish-pro commented Dec 29, 2022

Signed-off-by: Fish-pro [email protected]

What this PR does / why we need it:

Comparing with == will fail on wrapped errors. Use errors.Is to check for a specific error

Which issue(s) this PR fixes (optional, using fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when the PR gets merged):
Fixes #

Special notes for your reviewer:

@Fish-pro Fish-pro changed the title Use errors.Is to check for a specific error chore: use errors.Is to check for a specific error Dec 29, 2022
@codecov-commenter
Copy link

codecov-commenter commented Jan 2, 2023

Codecov Report

Base: 53.22% // Head: 53.19% // Decreases project coverage by -0.02% ⚠️

Coverage data is based on head (7448f4b) compared to base (a30d288).
Patch coverage: 33.33% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2483      +/-   ##
==========================================
- Coverage   53.22%   53.19%   -0.03%     
==========================================
  Files         116      116              
  Lines       10270    10270              
==========================================
- Hits         5466     5463       -3     
- Misses       4380     4382       +2     
- Partials      424      425       +1     
Flag Coverage Δ
unittests 53.19% <33.33%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/audit/manager.go 1.07% <0.00%> (ø)
pkg/gator/reader/read_constraints.go 12.50% <100.00%> (ø)
...onstrainttemplate/constrainttemplate_controller.go 55.74% <0.00%> (-0.72%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@sozercan sozercan left a comment

Choose a reason for hiding this comment

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

Thank you! LGTM

Copy link
Contributor

@maxsmythe maxsmythe left a comment

Choose a reason for hiding this comment

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

Thank you! LGTM

@ritazh ritazh merged commit 1422132 into open-policy-agent:master Jan 4, 2023
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.

5 participants