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

kumactl: improved error handling #127 #168

Merged
merged 1 commit into from
Sep 7, 2019

Conversation

jakubdyszkiewicz
Copy link
Contributor

We now pass the error message from the server.

Errors from protobuf library are not very informative :/ It's hard to deduce with which field there is a problem.

if statusCode != http.StatusOK {
return nil, errors.Errorf("unexpected status code: %d", statusCode)
if statusCode != 200 {
return nil, errors.Errorf("(%d): %s", statusCode, string(b))
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this error message is better ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because it shows error from the server. For example, when mesh is not found, previously we've got:
unexpected status code: 400
now we will see
(400): Mesh of name pilot is not found

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.

None yet

2 participants