{"action":"created","comment":{"url":"https://api.github.com/repos/smashingboxes/code-review-bot/pulls/comments/54494011","id":54494011,"diff_hunk":"@@ -30,19 +30,28 @@ class CrBot {\n     return null;\n   }\n \n-  onIncomingCodeReview(req, res, next) {\n-    let githubPRParams = this.getGitHubPRParams(req.body.text);\n-    let newCR;\n-    if (!githubPRParams) {\n-      return res.status(404)\n+  onSlackMessageIsBad(res, req) {\n+    return res.status(404)\n         .end(`Beep:Boop.\n           I could not find your repo.\n           Are you sure it is accessible to me?\n           Please double check your URL: ${req.body.text}`);\n+  }\n+\n+  onIncomingCodeReview(req, res, next) {\n+    let githubPRParams = this.getGitHubPRParams(req.body.text);\n+    let newCR;\n+    if (!githubPRParams) {\n+      return this.onSlackMessageIsBad(res, req);\n     }\n \n     return this.getPR(githubPRParams)\n       .then(githubResponse => {\n+        if ( !githubResponse[0] ) {","path":"lib/crbot.js","position":26,"original_position":26,"commit_id":"5c0d2b4e802c102cc181f5dbfbae7749a51ff71f","original_commit_id":"e8e35a62c80d5d9c726e8f1d6dfd4c8f1df8ba28","user":{"login":"keeganbrown","id":479440,"avatar_url":"https://avatars.githubusercontent.com/u/479440?v=3","gravatar_id":"","url":"https://api.github.com/users/keeganbrown","html_url":"https://github.com/keeganbrown","followers_url":"https://api.github.com/users/keeganbrown/followers","following_url":"https://api.github.com/users/keeganbrown/following{/other_user}","gists_url":"https://api.github.com/users/keeganbrown/gists{/gist_id}","starred_url":"https://api.github.com/users/keeganbrown/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keeganbrown/subscriptions","organizations_url":"https://api.github.com/users/keeganbrown/orgs","repos_url":"https://api.github.com/users/keeganbrown/repos","events_url":"https://api.github.com/users/keeganbrown/events{/privacy}","received_events_url":"https://api.github.com/users/keeganbrown/received_events","type":"User","site_admin":false},"body":"@zachary-kuhn Ok -- now this makes more sense. Please resume your CR :)","created_at":"2016-02-29T22:53:15Z","updated_at":"2016-02-29T22:53:15Z","html_url":"https://github.com/smashingboxes/code-review-bot/pull/28#discussion_r54494011","pull_request_url":"https://api.github.com/repos/smashingboxes/code-review-bot/pulls/28","_links":{"self":{"href":"https://api.github.com/repos/smashingboxes/code-review-bot/pulls/comments/54494011"},"html":{"href":"https://github.com/smashingboxes/code-review-bot/pull/28#discussion_r54494011"},"pull_request":{"href":"https://api.github.com/repos/smashingboxes/code-review-bot/pulls/28"}}},"pull_request":{"url":"https://api.github.com/repos/smashingboxes/code-review-bot/pulls/28","id":61120744,"html_url":"https://github.com/smashingboxes/code-review-bot/pull/28","diff_url":"https://github.com/smashingboxes/code-review-bot/pull/28.diff","patch_url":"https://github.com/smashingboxes/code-review-bot/pull/28.patch","issue_url":"https://api.github.com/repos/smashingboxes/code-review-bot/issues/28","number":28,"state":"open","locked":false,"title":"Fixes error handling and slack error response messaging","user":{"login":"keeganbrown","id":479440,"avatar_url":"https://avatars.githubusercontent.com/u/479440?v=3","gravatar_id":"","url":"https://api.github.com/users/keeganbrown","html_url":"https://github.com/keeganbrown","followers_url":"https://api.github.com/users/keeganbrown/followers","following_url":"https://api.github.com/users/keeganbrown/following{/other_user}","gists_url":"https://api.github.com/users/keeganbrown/gists{/gist_id}","starred_url":"https://api.github.com/users/keeganbrown/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keeganbrown/subscriptions","organizations_url":"https://api.github.com/users/keeganbrown/orgs","repos_url":"https://api.github.com/users/keeganbrown/repos","events_url":"https://api.github.com/users/keeganbrown/events{/privacy}","received_events_url":"https://api.github.com/users/keeganbrown/received_events","type":"User","site_admin":false},"body":"# Why?\r\n- Two different errors need to be handled -- a slack message that doesn't have a proper repo URL, and a slack message that contains a URL that can't be found. #26 \r\n\r\n# What changed?\r\n- Added error handling\r\n- Added test for error handling","created_at":"2016-02-29T18:20:37Z","updated_at":"2016-02-29T22:53:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e0c5519bbfc6954c70e44daf1673449a775f137b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/smashingboxes/code-review-bot/pulls/28/commits","review_comments_url":"https://api.github.com/repos/smashingboxes/code-review-bot/pulls/28/comments","review_comment_url":"https://api.github.com/repos/smashingboxes/code-review-bot/pulls/comments{/number}","comments_url":"https://api.github.com/repos/smashingboxes/code-review-bot/issues/28/comments","statuses_url":"https://api.github.com/repos/smashingboxes/code-review-bot/statuses/5c0d2b4e802c102cc181f5dbfbae7749a51ff71f","head":{"label":"smashingboxes:bug/bad-slack-message","ref":"bug/bad-slack-message","sha":"5c0d2b4e802c102cc181f5dbfbae7749a51ff71f","user":{"login":"smashingboxes","id":784473,"avatar_url":"https://avatars.githubusercontent.com/u/784473?v=3","gravatar_id":"","url":"https://api.github.com/users/smashingboxes","html_url":"https://github.com/smashingboxes","followers_url":"https://api.github.com/users/smashingboxes/followers","following_url":"https://api.github.com/users/smashingboxes/following{/other_user}","gists_url":"https://api.github.com/users/smashingboxes/gists{/gist_id}","starred_url":"https://api.github.com/users/smashingboxes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smashingboxes/subscriptions","organizations_url":"https://api.github.com/users/smashingboxes/orgs","repos_url":"https://api.github.com/users/smashingboxes/repos","events_url":"https://api.github.com/users/smashingboxes/events{/privacy}","received_events_url":"https://api.github.com/users/smashingboxes/received_events","type":"Organization","site_admin":false},"repo":{"id":50142699,"name":"code-review-bot","full_name":"smashingboxes/code-review-bot","owner":{"login":"smashingboxes","id":784473,"avatar_url":"https://avatars.githubusercontent.com/u/784473?v=3","gravatar_id":"","url":"https://api.github.com/users/smashingboxes","html_url":"https://github.com/smashingboxes","followers_url":"https://api.github.com/users/smashingboxes/followers","following_url":"https://api.github.com/users/smashingboxes/following{/other_user}","gists_url":"https://api.github.com/users/smashingboxes/gists{/gist_id}","starred_url":"https://api.github.com/users/smashingboxes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smashingboxes/subscriptions","organizations_url":"https://api.github.com/users/smashingboxes/orgs","repos_url":"https://api.github.com/users/smashingboxes/repos","events_url":"https://api.github.com/users/smashingboxes/events{/privacy}","received_events_url":"https://api.github.com/users/smashingboxes/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/smashingboxes/code-review-bot","description":"A Slackbot that helps the code review process","fork":false,"url":"https://api.github.com/repos/smashingboxes/code-review-bot","forks_url":"https://api.github.com/repos/smashingboxes/code-review-bot/forks","keys_url":"https://api.github.com/repos/smashingboxes/code-review-bot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/smashingboxes/code-review-bot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/smashingboxes/code-review-bot/teams","hooks_url":"https://api.github.com/repos/smashingboxes/code-review-bot/hooks","issue_events_url":"https://api.github.com/repos/smashingboxes/code-review-bot/issues/events{/number}","events_url":"https://api.github.com/repos/smashingboxes/code-review-bot/events","assignees_url":"https://api.github.com/repos/smashingboxes/code-review-bot/assignees{/user}","branches_url":"https://api.github.com/repos/smashingboxes/code-review-bot/branches{/branch}","tags_url":"https://api.github.com/repos/smashingboxes/code-review-bot/tags","blobs_url":"https://api.github.com/repos/smashingboxes/code-review-bot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/smashingboxes/code-review-bot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/smashingboxes/code-review-bot/git/refs{/sha}","trees_url":"https://api.github.com/repos/smashingboxes/code-review-bot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/smashingboxes/code-review-bot/statuses/{sha}","languages_url":"https://api.github.com/repos/smashingboxes/code-review-bot/languages","stargazers_url":"https://api.github.com/repos/smashingboxes/code-review-bot/stargazers","contributors_url":"https://api.github.com/repos/smashingboxes/code-review-bot/contributors","subscribers_url":"https://api.github.com/repos/smashingboxes/code-review-bot/subscribers","subscription_url":"https://api.github.com/repos/smashingboxes/code-review-bot/subscription","commits_url":"https://api.github.com/repos/smashingboxes/code-review-bot/commits{/sha}","git_commits_url":"https://api.github.com/repos/smashingboxes/code-review-bot/git/commits{/sha}","comments_url":"https://api.github.com/repos/smashingboxes/code-review-bot/comments{/number}","issue_comment_url":"https://api.github.com/repos/smashingboxes/code-review-bot/issues/comments{/number}","contents_url":"https://api.github.com/repos/smashingboxes/code-review-bot/contents/{+path}","compare_url":"https://api.github.com/repos/smashingboxes/code-review-bot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/smashingboxes/code-review-bot/merges","archive_url":"https://api.github.com/repos/smashingboxes/code-review-bot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/smashingboxes/code-review-bot/downloads","issues_url":"https://api.github.com/repos/smashingboxes/code-review-bot/issues{/number}","pulls_url":"https://api.github.com/repos/smashingboxes/code-review-bot/pulls{/number}","milestones_url":"https://api.github.com/repos/smashingboxes/code-review-bot/milestones{/number}","notifications_url":"https://api.github.com/repos/smashingboxes/code-review-bot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/smashingboxes/code-review-bot/labels{/name}","releases_url":"https://api.github.com/repos/smashingboxes/code-review-bot/releases{/id}","deployments_url":"https://api.github.com/repos/smashingboxes/code-review-bot/deployments","created_at":"2016-01-21T23:01:46Z","updated_at":"2016-02-23T22:47:10Z","pushed_at":"2016-02-29T21:26:34Z","git_url":"git://github.com/smashingboxes/code-review-bot.git","ssh_url":"git@github.com:smashingboxes/code-review-bot.git","clone_url":"https://github.com/smashingboxes/code-review-bot.git","svn_url":"https://github.com/smashingboxes/code-review-bot","homepage":"","size":86,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":10,"forks":0,"open_issues":10,"watchers":2,"default_branch":"master"}},"base":{"label":"smashingboxes:master","ref":"master","sha":"c984346a9f2f36d1d5a0ce4a360129b9de1033ae","user":{"login":"smashingboxes","id":784473,"avatar_url":"https://avatars.githubusercontent.com/u/784473?v=3","gravatar_id":"","url":"https://api.github.com/users/smashingboxes","html_url":"https://github.com/smashingboxes","followers_url":"https://api.github.com/users/smashingboxes/followers","following_url":"https://api.github.com/users/smashingboxes/following{/other_user}","gists_url":"https://api.github.com/users/smashingboxes/gists{/gist_id}","starred_url":"https://api.github.com/users/smashingboxes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smashingboxes/subscriptions","organizations_url":"https://api.github.com/users/smashingboxes/orgs","repos_url":"https://api.github.com/users/smashingboxes/repos","events_url":"https://api.github.com/users/smashingboxes/events{/privacy}","received_events_url":"https://api.github.com/users/smashingboxes/received_events","type":"Organization","site_admin":false},"repo":{"id":50142699,"name":"code-review-bot","full_name":"smashingboxes/code-review-bot","owner":{"login":"smashingboxes","id":784473,"avatar_url":"https://avatars.githubusercontent.com/u/784473?v=3","gravatar_id":"","url":"https://api.github.com/users/smashingboxes","html_url":"https://github.com/smashingboxes","followers_url":"https://api.github.com/users/smashingboxes/followers","following_url":"https://api.github.com/users/smashingboxes/following{/other_user}","gists_url":"https://api.github.com/users/smashingboxes/gists{/gist_id}","starred_url":"https://api.github.com/users/smashingboxes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smashingboxes/subscriptions","organizations_url":"https://api.github.com/users/smashingboxes/orgs","repos_url":"https://api.github.com/users/smashingboxes/repos","events_url":"https://api.github.com/users/smashingboxes/events{/privacy}","received_events_url":"https://api.github.com/users/smashingboxes/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/smashingboxes/code-review-bot","description":"A Slackbot that helps the code review process","fork":false,"url":"https://api.github.com/repos/smashingboxes/code-review-bot","forks_url":"https://api.github.com/repos/smashingboxes/code-review-bot/forks","keys_url":"https://api.github.com/repos/smashingboxes/code-review-bot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/smashingboxes/code-review-bot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/smashingboxes/code-review-bot/teams","hooks_url":"https://api.github.com/repos/smashingboxes/code-review-bot/hooks","issue_events_url":"https://api.github.com/repos/smashingboxes/code-review-bot/issues/events{/number}","events_url":"https://api.github.com/repos/smashingboxes/code-review-bot/events","assignees_url":"https://api.github.com/repos/smashingboxes/code-review-bot/assignees{/user}","branches_url":"https://api.github.com/repos/smashingboxes/code-review-bot/branches{/branch}","tags_url":"https://api.github.com/repos/smashingboxes/code-review-bot/tags","blobs_url":"https://api.github.com/repos/smashingboxes/code-review-bot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/smashingboxes/code-review-bot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/smashingboxes/code-review-bot/git/refs{/sha}","trees_url":"https://api.github.com/repos/smashingboxes/code-review-bot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/smashingboxes/code-review-bot/statuses/{sha}","languages_url":"https://api.github.com/repos/smashingboxes/code-review-bot/languages","stargazers_url":"https://api.github.com/repos/smashingboxes/code-review-bot/stargazers","contributors_url":"https://api.github.com/repos/smashingboxes/code-review-bot/contributors","subscribers_url":"https://api.github.com/repos/smashingboxes/code-review-bot/subscribers","subscription_url":"https://api.github.com/repos/smashingboxes/code-review-bot/subscription","commits_url":"https://api.github.com/repos/smashingboxes/code-review-bot/commits{/sha}","git_commits_url":"https://api.github.com/repos/smashingboxes/code-review-bot/git/commits{/sha}","comments_url":"https://api.github.com/repos/smashingboxes/code-review-bot/comments{/number}","issue_comment_url":"https://api.github.com/repos/smashingboxes/code-review-bot/issues/comments{/number}","contents_url":"https://api.github.com/repos/smashingboxes/code-review-bot/contents/{+path}","compare_url":"https://api.github.com/repos/smashingboxes/code-review-bot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/smashingboxes/code-review-bot/merges","archive_url":"https://api.github.com/repos/smashingboxes/code-review-bot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/smashingboxes/code-review-bot/downloads","issues_url":"https://api.github.com/repos/smashingboxes/code-review-bot/issues{/number}","pulls_url":"https://api.github.com/repos/smashingboxes/code-review-bot/pulls{/number}","milestones_url":"https://api.github.com/repos/smashingboxes/code-review-bot/milestones{/number}","notifications_url":"https://api.github.com/repos/smashingboxes/code-review-bot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/smashingboxes/code-review-bot/labels{/name}","releases_url":"https://api.github.com/repos/smashingboxes/code-review-bot/releases{/id}","deployments_url":"https://api.github.com/repos/smashingboxes/code-review-bot/deployments","created_at":"2016-01-21T23:01:46Z","updated_at":"2016-02-23T22:47:10Z","pushed_at":"2016-02-29T21:26:34Z","git_url":"git://github.com/smashingboxes/code-review-bot.git","ssh_url":"git@github.com:smashingboxes/code-review-bot.git","clone_url":"https://github.com/smashingboxes/code-review-bot.git","svn_url":"https://github.com/smashingboxes/code-review-bot","homepage":"","size":86,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":10,"forks":0,"open_issues":10,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/smashingboxes/code-review-bot/pulls/28"},"html":{"href":"https://github.com/smashingboxes/code-review-bot/pull/28"},"issue":{"href":"https://api.github.com/repos/smashingboxes/code-review-bot/issues/28"},"comments":{"href":"https://api.github.com/repos/smashingboxes/code-review-bot/issues/28/comments"},"review_comments":{"href":"https://api.github.com/repos/smashingboxes/code-review-bot/pulls/28/comments"},"review_comment":{"href":"https://api.github.com/repos/smashingboxes/code-review-bot/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/smashingboxes/code-review-bot/pulls/28/commits"},"statuses":{"href":"https://api.github.com/repos/smashingboxes/code-review-bot/statuses/5c0d2b4e802c102cc181f5dbfbae7749a51ff71f"}}}}