From 0c666ca25c920804fe24cf89d8854aa66cea34e7 Mon Sep 17 00:00:00 2001 From: hritikhks Date: Thu, 11 Oct 2018 16:13:42 +0530 Subject: [PATCH] github-graphql.js: Make error message configurable Displays warning only in debug mode. Thus makes it easier to spot real problems. Closes https://github.com/coala/gh-board/issues/88 --- src/github-graphql.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/github-graphql.js b/src/github-graphql.js index 45afacb0..f62aef25 100644 --- a/src/github-graphql.js +++ b/src/github-graphql.js @@ -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