-
Notifications
You must be signed in to change notification settings - Fork 369
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
Consider HTTP status for more meaningful errors #518
Consider HTTP status for more meaningful errors #518
Conversation
Let's hope the travis build is red 😆 |
ea91360
to
c4830b3
Compare
Codecov Report
@@ Coverage Diff @@
## master #518 +/- ##
========================================
- Coverage 59.12% 59% -0.12%
========================================
Files 23 23
Lines 1003 1005 +2
========================================
Hits 593 593
- Misses 350 351 +1
- Partials 60 61 +1
Continue to review full report at Codecov.
|
c4830b3
to
b75b4a7
Compare
The krew CI has quite a few problems on travis, supposedly due to API quota violation. For more meaningful errors, we now consider the HTTP status code of the GitHub API response.
@@ -36,6 +36,9 @@ func FetchLatestTag() (string, error) { | |||
if err != nil { | |||
return "", errors.Wrapf(err, "could not GET the latest release") | |||
} | |||
if response.StatusCode != http.StatusOK { | |||
return "", errors.Errorf("expected HTTP status 200 OK, got %s", response.Status) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we do %d as well (and use response.StatusCode)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the status code is part of the string. For example for status 200, its "200 OK"
.
/lgtm |
/hold |
b75b4a7
to
6c0472e
Compare
/hold cancel |
Ah.. finally. Took only 4 tries to get travis red 🐙
@ahmetb should we disable this test for the time being? Or skip for short tests |
Good lord, lets just delete that test. |
Really? If I remember correctly you were strongly in favor of having it 😉 I'll disable it for now. |
Yeah, let's add a |
4a72a1a
to
ccaa779
Compare
ccaa779
to
346147e
Compare
Ok, the test is skipped now and I added the todo. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ahmetb, corneliusweig The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
The krew CI has quite a few problems on travis, supposedly due to
API quota violation. For more meaningful errors, we now consider the
HTTP status code of the GitHub API response.
Fixes #516