Skip to content

Commit

Permalink
Avoid errors when offline
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmelnikow committed Oct 21, 2017
1 parent 6c9a91a commit 6aae294
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/github-auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ function githubRequest(request, url, query, cb) {
const qs = querystring.stringify(query);
if (qs) { url += '?' + qs; }
request(url, {headers: headers}, function(err, res, buffer) {
if (githubToken != null) {
if (githubToken != null && err === null) {
if (res.statusCode === 401) { // Unauthorized.
rmGithubToken(githubToken);
} else {
Expand Down

0 comments on commit 6aae294

Please sign in to comment.