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

Return cni.type.Error instead of plain error #406

Merged
merged 1 commit into from
Jun 8, 2017
Merged

Return cni.type.Error instead of plain error #406

merged 1 commit into from
Jun 8, 2017

Conversation

GheRivero
Copy link
Contributor

This way, we can use Error.Code attribute to check error type without
needing to regexp the message string

kubernetes/kubernetes#43014

@@ -52,11 +52,7 @@ func pluginErr(err error, output []byte) error {
if perr := json.Unmarshal(output, &emsg); perr != nil {
return fmt.Errorf("netplugin failed but error parsing its diagnostic message %q: %v", string(output), perr)
Copy link
Member

Choose a reason for hiding this comment

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

Do we want to generate a types.Error for this condition as well? Then we can tighten up the return types.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure!

@dcbw
Copy link
Member

dcbw commented Mar 18, 2017

LGTM after the change Casey requested.

This way, we can use Error.Code attribute to check error type without
needing to regexp the message string
@GheRivero
Copy link
Contributor Author

Commit updated with suggestion

@squeed
Copy link
Member

squeed commented Mar 28, 2017

LGTM, thanks!

@squeed squeed merged commit 2d3fa84 into containernetworking:master Jun 8, 2017
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.

3 participants