{"action":"created","comment":{"url":"https://api.github.com/repos/npm/newww/pulls/comments/43183716","id":43183716,"diff_hunk":"@@ -306,32 +306,35 @@ Org.prototype.getTeams = function(name, callback) {\n Org.prototype.removeUser = function(name, userId, callback) {\n   var url = USER_HOST + '/org/' + name + '/user/' + userId;\n \n-  Request.del({\n-    url: url,\n-    json: true,\n-    id: name,\n-    userId: userId,\n-    headers: {\n-      bearer: this.bearer\n-    }\n-  }, function(err, resp, removedUser) {\n-    if (err) {\n-      callback(err);\n-    }\n+  return new P(function(accept, reject) {\n+    Request.del({\n+      url: url,\n+      json: true,\n+      id: name,\n+      userId: userId,\n+      headers: {\n+        bearer: this.bearer\n+      }\n+    }, function(err, resp, removedUser) {\n+      if (err) {\n+        return reject(err);\n+      }\n \n-    if (resp.statusCode === 404) {\n-      err = Error('org or user not found');\n-      err.statusCode = resp.statusCode;\n-      return callback(err);\n-    }\n+      if (resp.statusCode === 404) {\n+        err = Error('org or user not found');\n+        err.statusCode = resp.statusCode;\n+        return reject(err);\n+      }\n \n-    if (resp.statusCode >= 400) {\n-      err = new Error(body);\n-      err.statusCode = resp.statusCode;\n-      return callback(err);\n-    }\n+      if (resp.statusCode >= 400) {\n+        err = new Error(removedUser);\n+        err.statusCode = resp.statusCode;\n+        return reject(err);\n+      }\n \n+      return accept(removedUser);\n+\n+    });\n+  }.bind(this)).nodeify(callback);","path":"agents/org.js","position":55,"original_position":55,"commit_id":"6a14c0045ef39fa114fd0b3484356ae9dcfe6568","original_commit_id":"6a14c0045ef39fa114fd0b3484356ae9dcfe6568","user":{"login":"rockbot","id":954269,"avatar_url":"https://avatars.githubusercontent.com/u/954269?v=3","gravatar_id":"","url":"https://api.github.com/users/rockbot","html_url":"https://github.com/rockbot","followers_url":"https://api.github.com/users/rockbot/followers","following_url":"https://api.github.com/users/rockbot/following{/other_user}","gists_url":"https://api.github.com/users/rockbot/gists{/gist_id}","starred_url":"https://api.github.com/users/rockbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rockbot/subscriptions","organizations_url":"https://api.github.com/users/rockbot/orgs","repos_url":"https://api.github.com/users/rockbot/repos","events_url":"https://api.github.com/users/rockbot/events{/privacy}","received_events_url":"https://api.github.com/users/rockbot/received_events","type":"User","site_admin":false},"body":"the bind pattern isn't something we use elsewhere in the codebase (we generally use `var self = this;`)... I don't mind it, but think we should be consistent... thoughts?","created_at":"2015-10-27T20:42:31Z","updated_at":"2015-10-27T20:42:31Z","html_url":"https://github.com/npm/newww/pull/1441#discussion_r43183716","pull_request_url":"https://api.github.com/repos/npm/newww/pulls/1441","_links":{"self":{"href":"https://api.github.com/repos/npm/newww/pulls/comments/43183716"},"html":{"href":"https://github.com/npm/newww/pull/1441#discussion_r43183716"},"pull_request":{"href":"https://api.github.com/repos/npm/newww/pulls/1441"}}},"pull_request":{"url":"https://api.github.com/repos/npm/newww/pulls/1441","id":48928707,"html_url":"https://github.com/npm/newww/pull/1441","diff_url":"https://github.com/npm/newww/pull/1441.diff","patch_url":"https://github.com/npm/newww/pull/1441.patch","issue_url":"https://api.github.com/repos/npm/newww/issues/1441","number":1441,"state":"open","locked":false,"title":"Handle 500 delete","user":{"login":"jefflembeck","id":109699,"avatar_url":"https://avatars.githubusercontent.com/u/109699?v=3","gravatar_id":"","url":"https://api.github.com/users/jefflembeck","html_url":"https://github.com/jefflembeck","followers_url":"https://api.github.com/users/jefflembeck/followers","following_url":"https://api.github.com/users/jefflembeck/following{/other_user}","gists_url":"https://api.github.com/users/jefflembeck/gists{/gist_id}","starred_url":"https://api.github.com/users/jefflembeck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jefflembeck/subscriptions","organizations_url":"https://api.github.com/users/jefflembeck/orgs","repos_url":"https://api.github.com/users/jefflembeck/repos","events_url":"https://api.github.com/users/jefflembeck/events{/privacy}","received_events_url":"https://api.github.com/users/jefflembeck/received_events","type":"User","site_admin":false},"body":"We've got a 500 on production and it needs handling.\r\n\r\nThis change involved some serious promisifying of our handler, so I could better track the errors - 4xx errors are now displayed as notices while 5xx errors are sent to an internal page.\r\n\r\nTest added for 500.","created_at":"2015-10-27T20:38:04Z","updated_at":"2015-10-27T20:42:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"094af3380d6cffa08da9dfc06dc37e234f028883","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/npm/newww/pulls/1441/commits","review_comments_url":"https://api.github.com/repos/npm/newww/pulls/1441/comments","review_comment_url":"https://api.github.com/repos/npm/newww/pulls/comments{/number}","comments_url":"https://api.github.com/repos/npm/newww/issues/1441/comments","statuses_url":"https://api.github.com/repos/npm/newww/statuses/6a14c0045ef39fa114fd0b3484356ae9dcfe6568","head":{"label":"npm:handle-500-delete","ref":"handle-500-delete","sha":"6a14c0045ef39fa114fd0b3484356ae9dcfe6568","user":{"login":"npm","id":6078720,"avatar_url":"https://avatars.githubusercontent.com/u/6078720?v=3","gravatar_id":"","url":"https://api.github.com/users/npm","html_url":"https://github.com/npm","followers_url":"https://api.github.com/users/npm/followers","following_url":"https://api.github.com/users/npm/following{/other_user}","gists_url":"https://api.github.com/users/npm/gists{/gist_id}","starred_url":"https://api.github.com/users/npm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/npm/subscriptions","organizations_url":"https://api.github.com/users/npm/orgs","repos_url":"https://api.github.com/users/npm/repos","events_url":"https://api.github.com/users/npm/events{/privacy}","received_events_url":"https://api.github.com/users/npm/received_events","type":"Organization","site_admin":false},"repo":{"id":19872239,"name":"newww","full_name":"npm/newww","owner":{"login":"npm","id":6078720,"avatar_url":"https://avatars.githubusercontent.com/u/6078720?v=3","gravatar_id":"","url":"https://api.github.com/users/npm","html_url":"https://github.com/npm","followers_url":"https://api.github.com/users/npm/followers","following_url":"https://api.github.com/users/npm/following{/other_user}","gists_url":"https://api.github.com/users/npm/gists{/gist_id}","starred_url":"https://api.github.com/users/npm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/npm/subscriptions","organizations_url":"https://api.github.com/users/npm/orgs","repos_url":"https://api.github.com/users/npm/repos","events_url":"https://api.github.com/users/npm/events{/privacy}","received_events_url":"https://api.github.com/users/npm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/npm/newww","description":"The npm website","fork":false,"url":"https://api.github.com/repos/npm/newww","forks_url":"https://api.github.com/repos/npm/newww/forks","keys_url":"https://api.github.com/repos/npm/newww/keys{/key_id}","collaborators_url":"https://api.github.com/repos/npm/newww/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/npm/newww/teams","hooks_url":"https://api.github.com/repos/npm/newww/hooks","issue_events_url":"https://api.github.com/repos/npm/newww/issues/events{/number}","events_url":"https://api.github.com/repos/npm/newww/events","assignees_url":"https://api.github.com/repos/npm/newww/assignees{/user}","branches_url":"https://api.github.com/repos/npm/newww/branches{/branch}","tags_url":"https://api.github.com/repos/npm/newww/tags","blobs_url":"https://api.github.com/repos/npm/newww/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/npm/newww/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/npm/newww/git/refs{/sha}","trees_url":"https://api.github.com/repos/npm/newww/git/trees{/sha}","statuses_url":"https://api.github.com/repos/npm/newww/statuses/{sha}","languages_url":"https://api.github.com/repos/npm/newww/languages","stargazers_url":"https://api.github.com/repos/npm/newww/stargazers","contributors_url":"https://api.github.com/repos/npm/newww/contributors","subscribers_url":"https://api.github.com/repos/npm/newww/subscribers","subscription_url":"https://api.github.com/repos/npm/newww/subscription","commits_url":"https://api.github.com/repos/npm/newww/commits{/sha}","git_commits_url":"https://api.github.com/repos/npm/newww/git/commits{/sha}","comments_url":"https://api.github.com/repos/npm/newww/comments{/number}","issue_comment_url":"https://api.github.com/repos/npm/newww/issues/comments{/number}","contents_url":"https://api.github.com/repos/npm/newww/contents/{+path}","compare_url":"https://api.github.com/repos/npm/newww/compare/{base}...{head}","merges_url":"https://api.github.com/repos/npm/newww/merges","archive_url":"https://api.github.com/repos/npm/newww/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/npm/newww/downloads","issues_url":"https://api.github.com/repos/npm/newww/issues{/number}","pulls_url":"https://api.github.com/repos/npm/newww/pulls{/number}","milestones_url":"https://api.github.com/repos/npm/newww/milestones{/number}","notifications_url":"https://api.github.com/repos/npm/newww/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/npm/newww/labels{/name}","releases_url":"https://api.github.com/repos/npm/newww/releases{/id}","created_at":"2014-05-16T22:12:47Z","updated_at":"2015-10-23T00:25:53Z","pushed_at":"2015-10-27T20:38:04Z","git_url":"git://github.com/npm/newww.git","ssh_url":"git@github.com:npm/newww.git","clone_url":"https://github.com/npm/newww.git","svn_url":"https://github.com/npm/newww","homepage":"http://npmjs.com","size":17531,"stargazers_count":446,"watchers_count":446,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":156,"mirror_url":null,"open_issues_count":242,"forks":156,"open_issues":242,"watchers":446,"default_branch":"master"}},"base":{"label":"npm:master","ref":"master","sha":"ce3425f5c20255093eca0d9a025e0322d885d006","user":{"login":"npm","id":6078720,"avatar_url":"https://avatars.githubusercontent.com/u/6078720?v=3","gravatar_id":"","url":"https://api.github.com/users/npm","html_url":"https://github.com/npm","followers_url":"https://api.github.com/users/npm/followers","following_url":"https://api.github.com/users/npm/following{/other_user}","gists_url":"https://api.github.com/users/npm/gists{/gist_id}","starred_url":"https://api.github.com/users/npm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/npm/subscriptions","organizations_url":"https://api.github.com/users/npm/orgs","repos_url":"https://api.github.com/users/npm/repos","events_url":"https://api.github.com/users/npm/events{/privacy}","received_events_url":"https://api.github.com/users/npm/received_events","type":"Organization","site_admin":false},"repo":{"id":19872239,"name":"newww","full_name":"npm/newww","owner":{"login":"npm","id":6078720,"avatar_url":"https://avatars.githubusercontent.com/u/6078720?v=3","gravatar_id":"","url":"https://api.github.com/users/npm","html_url":"https://github.com/npm","followers_url":"https://api.github.com/users/npm/followers","following_url":"https://api.github.com/users/npm/following{/other_user}","gists_url":"https://api.github.com/users/npm/gists{/gist_id}","starred_url":"https://api.github.com/users/npm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/npm/subscriptions","organizations_url":"https://api.github.com/users/npm/orgs","repos_url":"https://api.github.com/users/npm/repos","events_url":"https://api.github.com/users/npm/events{/privacy}","received_events_url":"https://api.github.com/users/npm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/npm/newww","description":"The npm website","fork":false,"url":"https://api.github.com/repos/npm/newww","forks_url":"https://api.github.com/repos/npm/newww/forks","keys_url":"https://api.github.com/repos/npm/newww/keys{/key_id}","collaborators_url":"https://api.github.com/repos/npm/newww/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/npm/newww/teams","hooks_url":"https://api.github.com/repos/npm/newww/hooks","issue_events_url":"https://api.github.com/repos/npm/newww/issues/events{/number}","events_url":"https://api.github.com/repos/npm/newww/events","assignees_url":"https://api.github.com/repos/npm/newww/assignees{/user}","branches_url":"https://api.github.com/repos/npm/newww/branches{/branch}","tags_url":"https://api.github.com/repos/npm/newww/tags","blobs_url":"https://api.github.com/repos/npm/newww/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/npm/newww/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/npm/newww/git/refs{/sha}","trees_url":"https://api.github.com/repos/npm/newww/git/trees{/sha}","statuses_url":"https://api.github.com/repos/npm/newww/statuses/{sha}","languages_url":"https://api.github.com/repos/npm/newww/languages","stargazers_url":"https://api.github.com/repos/npm/newww/stargazers","contributors_url":"https://api.github.com/repos/npm/newww/contributors","subscribers_url":"https://api.github.com/repos/npm/newww/subscribers","subscription_url":"https://api.github.com/repos/npm/newww/subscription","commits_url":"https://api.github.com/repos/npm/newww/commits{/sha}","git_commits_url":"https://api.github.com/repos/npm/newww/git/commits{/sha}","comments_url":"https://api.github.com/repos/npm/newww/comments{/number}","issue_comment_url":"https://api.github.com/repos/npm/newww/issues/comments{/number}","contents_url":"https://api.github.com/repos/npm/newww/contents/{+path}","compare_url":"https://api.github.com/repos/npm/newww/compare/{base}...{head}","merges_url":"https://api.github.com/repos/npm/newww/merges","archive_url":"https://api.github.com/repos/npm/newww/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/npm/newww/downloads","issues_url":"https://api.github.com/repos/npm/newww/issues{/number}","pulls_url":"https://api.github.com/repos/npm/newww/pulls{/number}","milestones_url":"https://api.github.com/repos/npm/newww/milestones{/number}","notifications_url":"https://api.github.com/repos/npm/newww/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/npm/newww/labels{/name}","releases_url":"https://api.github.com/repos/npm/newww/releases{/id}","created_at":"2014-05-16T22:12:47Z","updated_at":"2015-10-23T00:25:53Z","pushed_at":"2015-10-27T20:38:04Z","git_url":"git://github.com/npm/newww.git","ssh_url":"git@github.com:npm/newww.git","clone_url":"https://github.com/npm/newww.git","svn_url":"https://github.com/npm/newww","homepage":"http://npmjs.com","size":17531,"stargazers_count":446,"watchers_count":446,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":156,"mirror_url":null,"open_issues_count":242,"forks":156,"open_issues":242,"watchers":446,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/npm/newww/pulls/1441"},"html":{"href":"https://github.com/npm/newww/pull/1441"},"issue":{"href":"https://api.github.com/repos/npm/newww/issues/1441"},"comments":{"href":"https://api.github.com/repos/npm/newww/issues/1441/comments"},"review_comments":{"href":"https://api.github.com/repos/npm/newww/pulls/1441/comments"},"review_comment":{"href":"https://api.github.com/repos/npm/newww/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/npm/newww/pulls/1441/commits"},"statuses":{"href":"https://api.github.com/repos/npm/newww/statuses/6a14c0045ef39fa114fd0b3484356ae9dcfe6568"}}}}