Skip to content

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

Merged
ritazh merged 2 commits into
open-policy-agent:masterfrom
Fish-pro:cleanup/erroris
Jan 4, 2023
Merged

chore: use errors.Is to check for a specific error#2483
ritazh merged 2 commits into
open-policy-agent:masterfrom
Fish-pro:cleanup/erroris

Conversation

@Fish-pro
Copy link
Copy Markdown

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

Signed-off-by: Fish-pro zechun.chen@daocloud.io

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:

Signed-off-by: Fish-pro <zechun.chen@daocloud.io>
@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
Copy Markdown

codecov-commenter commented Jan 2, 2023

Codecov Report

Attention: Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 53.19%. Comparing base (a30d288) to head (7448f4b).
Report is 721 commits behind head on master.

Files with missing lines Patch % Lines
pkg/audit/manager.go 0.00% 2 Missing ⚠️
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.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
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
Copy Markdown
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