From ef228e0b542ca3c0f2604419fe8fc2b75462fbdf Mon Sep 17 00:00:00 2001 From: vlymar Date: Fri, 23 Jun 2017 15:57:14 -0700 Subject: [PATCH] Revert "handleErrors must be registered on github module, not instance of client. (#20)" This reverts commit 098b118488e6b74be6d52e564ad725460595f25b. --- scripts/github-deploy.coffee | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/github-deploy.coffee b/scripts/github-deploy.coffee index 3fefc80..7687c72 100644 --- a/scripts/github-deploy.coffee +++ b/scripts/github-deploy.coffee @@ -13,9 +13,6 @@ module.exports = (robot) -> robot.brain.data.deploys ||= [] github = require("githubot") - github.handleErrors (response) -> - msg.send "An error occurred: #{response.statusCode} | #{response.error} | #{response.body}" - addDeploy = (repoName) -> robot.brain.data.deploys.push(repoName) robot.brain.data.deploys = _.uniq(robot.brain.data.deploys) @@ -53,6 +50,9 @@ module.exports = (robot) -> client = github(robot, options) + client.handleErrors (response) -> + msg.send "An error occurred: #{response.error}" + client.post "repos/dobtco/#{repoName}/pulls", title: 'Deploy to production' head: 'master'