Skip to content

Commit

Permalink
github-graphql.js: Make error message configurable
Browse files Browse the repository at this point in the history
Displays warning only in debug mode. Thus makes it
easier to spot real problems.

Closes #88
  • Loading branch information
hritikhks committed Oct 12, 2018
1 parent a1b04dc commit 0c666ca
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/github-graphql.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,12 @@ class GraphQLClient {
data.repository.pullRequest.comments.nodes);
} else {
this.warningCount++;
console.log('warning: no available reaction data!',
'owner:', owner, 'name:', name, 'pull request number:', number,
'error:', errors);
if (DEBUG) {
console.log('warning: no available reaction data!',
'owner:', owner, 'name:', name, 'pull request number:', number,
'error:', errors);
}

return await this._handleWarning(this._fetchReactions);
}
// reactions are wrapped by corresponding comment
Expand Down

0 comments on commit 0c666ca

Please sign in to comment.