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

pkg/ip: use type cast instead of untrusty error message #445

Merged
merged 1 commit into from
Jan 29, 2020

Conversation

mars1024
Copy link
Member

Error message is untrusty.
From vishvananda/netlink@99091d8 and codes, we can see that there are three kinds of error message about not found

  • Link %s not found
  • Link alias %s not found
  • Link not found

Our judgment will obviously fail in some cases, and type cast to LinkNotFoundError is more proper to help distinguish not found error from others.

Signed-off-by: Bruce Ma [email protected]

Copy link
Member

@jellonek jellonek left a comment

Choose a reason for hiding this comment

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

When we will switch to supporting only golang >=1.13 it would be best to switch that to https://golang.org/pkg/errors/#Is but at the moment - this is the best what we IMO can have.

Copy link
Contributor

@bboreham bboreham left a comment

Choose a reason for hiding this comment

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

Seems an improvement, thanks.

@dcbw dcbw merged commit 66e0aaf into containernetworking:master Jan 29, 2020
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.

4 participants