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

Better error reporting for image policy evaluation #144

Merged
merged 1 commit into from
May 25, 2021

Conversation

relu
Copy link
Member

@relu relu commented May 14, 2021

A more verbose message associated with the error should give the user
better understanding of the cause and the nature of the failure.

@relu relu requested a review from squaremo May 14, 2021 17:05
A more verbose message associated with the error should give the user
better understanding of the cause and the nature of the failure.

Fixes #143

Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
@relu relu force-pushed the error-reporting-image-policy branch 2 times, most recently from dd743fb to 746f61e Compare May 14, 2021 17:06
Copy link
Member

@squaremo squaremo left a comment

Choose a reason for hiding this comment

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

A sensible improvement, thanks @relu 🍇

@@ -66,7 +66,7 @@ func (p *Numerical) Latest(versions []string) (string, error) {

switch {
case i == 0:
break // First iteration, nothing to compare
// First iteration, nothing to compare
Copy link
Member

Choose a reason for hiding this comment

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

I like the explicit break, since it disambiguates for people who have trouble remembering whether Go's case has fall-through or not (like me).

Copy link
Member Author

Choose a reason for hiding this comment

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

I just went with the linter recommendation. I can definitely revert back to using break if you think it's worth it, no problem.

Copy link
Member

Choose a reason for hiding this comment

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

I often find myself disagreeing with linters. Maybe I should consider .... rewriting all the linters ...

Copy link
Member

Choose a reason for hiding this comment

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

Not a blocker, I leave it to your judgement @relu :-)

@relu relu merged commit c0ee790 into main May 25, 2021
@relu relu deleted the error-reporting-image-policy branch May 25, 2021 12:43
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