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

Fix label check and add test #45

Merged
merged 1 commit into from
Apr 29, 2024
Merged

Fix label check and add test #45

merged 1 commit into from
Apr 29, 2024

Conversation

ashmrtn
Copy link
Contributor

@ashmrtn ashmrtn commented Apr 25, 2024

Implementation was originally only comparing against the labels in the top-level error. Therefore, if the label existed in one of the stacked errors it wouldn't be found if > 1 error was passed to clues.Stack() but would be reported by clues.Labels()

@ashmrtn ashmrtn added the bug Something isn't working label Apr 25, 2024
@ashmrtn ashmrtn requested a review from ryanfkeepers April 25, 2024 20:33
@ashmrtn ashmrtn self-assigned this Apr 25, 2024
Copy link
Contributor

@ryanfkeepers ryanfkeepers 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!

@@ -118,7 +118,10 @@ func (err *Err) HasLabel(label string) bool {
return false
}

if _, ok := err.labels[label]; ok {
// Check all labels in the error and it's stack since the stack isn't
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Check all labels in the error and it's stack since the stack isn't
// Check all labels in the error and its stack since the stack isn't

@ryanfkeepers ryanfkeepers merged commit 48ef099 into main Apr 29, 2024
1 check passed
@ryanfkeepers ryanfkeepers deleted the fix-has-label branch April 29, 2024 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants