handle failed policy set-version - #7848
Merged
Merged
Conversation
olingern
commented
Jan 27, 2020
|
|
||
| const server = res.caseless.get('server'); | ||
|
|
||
| if (res.statusCode === 401 && server === "GitHub.com") { |
Contributor
Author
There was a problem hiding this comment.
Not sure if a constant is worth using here. Request manager is probably too generic in some ways. Would be nice to have a Github only request manager so stuff like this could be avoided. For now, I don't think this is terrible.
olingern
commented
Jan 27, 2020
| }); | ||
| } catch (e) { | ||
| reporter.error(e.message); | ||
| return; |
Contributor
Author
There was a problem hiding this comment.
In the event of a promise rejection, report and return early
|
olingern
force-pushed
the
fix-set-version-upon-failure
branch
from
January 27, 2020 18:01
f9f2c53 to
208e40a
Compare
Member
|
Thanks 👍 |
VincentBailly
pushed a commit
to VincentBailly/yarn
that referenced
this pull request
Jun 10, 2020
* handle failed policy set-version * linting * handle instances where caseless is not defined on response
VincentBailly
pushed a commit
to VincentBailly/yarn
that referenced
this pull request
Jun 10, 2020
* handle failed policy set-version * linting * handle instances where caseless is not defined on response
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Right now
policies set-versiondoes not handle invalid scenarios where an invalid github token is provided or the request fails.Test plan
Will add a test that mocks a 401 from Github's API and that the reporter correctly logs.