{"action":"created","comment":{"url":"https://api.github.com/repos/Financial-Times/next-flags-api/pulls/comments/60094946","id":60094946,"diff_hunk":"@@ -18,8 +18,6 @@ function handleValidationError(validationResult, res, cr){\n \tdebug('event=VALIDATION_ERROR errors=%s', errors);\n \tres.set('Error-Message', errors);\n \tcr.cancel(res);\n-\tres.status(400);\n-\tres.json(validationResult);\n \tthrow new Error('ValidationError: ' + errors);","path":"src/js/v1/controllers/flags.controller.js","position":6,"original_position":6,"commit_id":"0989bfff6034877d42c400c0e93a41a1053150e0","original_commit_id":"0989bfff6034877d42c400c0e93a41a1053150e0","user":{"login":"adambraimbridge","id":224547,"avatar_url":"https://avatars.githubusercontent.com/u/224547?v=3","gravatar_id":"","url":"https://api.github.com/users/adambraimbridge","html_url":"https://github.com/adambraimbridge","followers_url":"https://api.github.com/users/adambraimbridge/followers","following_url":"https://api.github.com/users/adambraimbridge/following{/other_user}","gists_url":"https://api.github.com/users/adambraimbridge/gists{/gist_id}","starred_url":"https://api.github.com/users/adambraimbridge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adambraimbridge/subscriptions","organizations_url":"https://api.github.com/users/adambraimbridge/orgs","repos_url":"https://api.github.com/users/adambraimbridge/repos","events_url":"https://api.github.com/users/adambraimbridge/events{/privacy}","received_events_url":"https://api.github.com/users/adambraimbridge/received_events","type":"User","site_admin":false},"body":"Because there's a `throw new Error()` here, the `res.status` is set to 500, overwriting the 400 here. I'm not sure how to prevent that.\r\n\r\n... and calling `res.json()` results in a `headers cannot be resent` error.","created_at":"2016-04-18T17:02:49Z","updated_at":"2016-04-18T17:02:49Z","html_url":"https://github.com/Financial-Times/next-flags-api/pull/47#discussion_r60094946","pull_request_url":"https://api.github.com/repos/Financial-Times/next-flags-api/pulls/47","_links":{"self":{"href":"https://api.github.com/repos/Financial-Times/next-flags-api/pulls/comments/60094946"},"html":{"href":"https://github.com/Financial-Times/next-flags-api/pull/47#discussion_r60094946"},"pull_request":{"href":"https://api.github.com/repos/Financial-Times/next-flags-api/pulls/47"}}},"pull_request":{"url":"https://api.github.com/repos/Financial-Times/next-flags-api/pulls/47","id":66887184,"html_url":"https://github.com/Financial-Times/next-flags-api/pull/47","diff_url":"https://github.com/Financial-Times/next-flags-api/pull/47.diff","patch_url":"https://github.com/Financial-Times/next-flags-api/pull/47.patch","issue_url":"https://api.github.com/repos/Financial-Times/next-flags-api/issues/47","number":47,"state":"open","locked":false,"title":"Fix tests","user":{"login":"adambraimbridge","id":224547,"avatar_url":"https://avatars.githubusercontent.com/u/224547?v=3","gravatar_id":"","url":"https://api.github.com/users/adambraimbridge","html_url":"https://github.com/adambraimbridge","followers_url":"https://api.github.com/users/adambraimbridge/followers","following_url":"https://api.github.com/users/adambraimbridge/following{/other_user}","gists_url":"https://api.github.com/users/adambraimbridge/gists{/gist_id}","starred_url":"https://api.github.com/users/adambraimbridge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adambraimbridge/subscriptions","organizations_url":"https://api.github.com/users/adambraimbridge/orgs","repos_url":"https://api.github.com/users/adambraimbridge/repos","events_url":"https://api.github.com/users/adambraimbridge/events{/privacy}","received_events_url":"https://api.github.com/users/adambraimbridge/received_events","type":"User","site_admin":false},"body":"cc @laurieboyes @GlynnPhillips @matthew-andrews @aintgoin2goa \r\n\r\n![image](https://cloud.githubusercontent.com/assets/224547/14612517/5c3d2f06-058f-11e6-86f2-2fbae7147130.png)\r\n","created_at":"2016-04-18T17:00:01Z","updated_at":"2016-04-18T17:02:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f46cd4efd8301860a8f2b5b0cd42c86d940696a3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Financial-Times/next-flags-api/pulls/47/commits","review_comments_url":"https://api.github.com/repos/Financial-Times/next-flags-api/pulls/47/comments","review_comment_url":"https://api.github.com/repos/Financial-Times/next-flags-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Financial-Times/next-flags-api/issues/47/comments","statuses_url":"https://api.github.com/repos/Financial-Times/next-flags-api/statuses/0989bfff6034877d42c400c0e93a41a1053150e0","head":{"label":"Financial-Times:fix-tests","ref":"fix-tests","sha":"0989bfff6034877d42c400c0e93a41a1053150e0","user":{"login":"Financial-Times","id":3502508,"avatar_url":"https://avatars.githubusercontent.com/u/3502508?v=3","gravatar_id":"","url":"https://api.github.com/users/Financial-Times","html_url":"https://github.com/Financial-Times","followers_url":"https://api.github.com/users/Financial-Times/followers","following_url":"https://api.github.com/users/Financial-Times/following{/other_user}","gists_url":"https://api.github.com/users/Financial-Times/gists{/gist_id}","starred_url":"https://api.github.com/users/Financial-Times/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Financial-Times/subscriptions","organizations_url":"https://api.github.com/users/Financial-Times/orgs","repos_url":"https://api.github.com/users/Financial-Times/repos","events_url":"https://api.github.com/users/Financial-Times/events{/privacy}","received_events_url":"https://api.github.com/users/Financial-Times/received_events","type":"Organization","site_admin":false},"repo":{"id":41363660,"name":"next-flags-api","full_name":"Financial-Times/next-flags-api","owner":{"login":"Financial-Times","id":3502508,"avatar_url":"https://avatars.githubusercontent.com/u/3502508?v=3","gravatar_id":"","url":"https://api.github.com/users/Financial-Times","html_url":"https://github.com/Financial-Times","followers_url":"https://api.github.com/users/Financial-Times/followers","following_url":"https://api.github.com/users/Financial-Times/following{/other_user}","gists_url":"https://api.github.com/users/Financial-Times/gists{/gist_id}","starred_url":"https://api.github.com/users/Financial-Times/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Financial-Times/subscriptions","organizations_url":"https://api.github.com/users/Financial-Times/orgs","repos_url":"https://api.github.com/users/Financial-Times/repos","events_url":"https://api.github.com/users/Financial-Times/events{/privacy}","received_events_url":"https://api.github.com/users/Financial-Times/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Financial-Times/next-flags-api","description":"New Flags API","fork":false,"url":"https://api.github.com/repos/Financial-Times/next-flags-api","forks_url":"https://api.github.com/repos/Financial-Times/next-flags-api/forks","keys_url":"https://api.github.com/repos/Financial-Times/next-flags-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Financial-Times/next-flags-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Financial-Times/next-flags-api/teams","hooks_url":"https://api.github.com/repos/Financial-Times/next-flags-api/hooks","issue_events_url":"https://api.github.com/repos/Financial-Times/next-flags-api/issues/events{/number}","events_url":"https://api.github.com/repos/Financial-Times/next-flags-api/events","assignees_url":"https://api.github.com/repos/Financial-Times/next-flags-api/assignees{/user}","branches_url":"https://api.github.com/repos/Financial-Times/next-flags-api/branches{/branch}","tags_url":"https://api.github.com/repos/Financial-Times/next-flags-api/tags","blobs_url":"https://api.github.com/repos/Financial-Times/next-flags-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Financial-Times/next-flags-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Financial-Times/next-flags-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/Financial-Times/next-flags-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Financial-Times/next-flags-api/statuses/{sha}","languages_url":"https://api.github.com/repos/Financial-Times/next-flags-api/languages","stargazers_url":"https://api.github.com/repos/Financial-Times/next-flags-api/stargazers","contributors_url":"https://api.github.com/repos/Financial-Times/next-flags-api/contributors","subscribers_url":"https://api.github.com/repos/Financial-Times/next-flags-api/subscribers","subscription_url":"https://api.github.com/repos/Financial-Times/next-flags-api/subscription","commits_url":"https://api.github.com/repos/Financial-Times/next-flags-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/Financial-Times/next-flags-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/Financial-Times/next-flags-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/Financial-Times/next-flags-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/Financial-Times/next-flags-api/contents/{+path}","compare_url":"https://api.github.com/repos/Financial-Times/next-flags-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Financial-Times/next-flags-api/merges","archive_url":"https://api.github.com/repos/Financial-Times/next-flags-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Financial-Times/next-flags-api/downloads","issues_url":"https://api.github.com/repos/Financial-Times/next-flags-api/issues{/number}","pulls_url":"https://api.github.com/repos/Financial-Times/next-flags-api/pulls{/number}","milestones_url":"https://api.github.com/repos/Financial-Times/next-flags-api/milestones{/number}","notifications_url":"https://api.github.com/repos/Financial-Times/next-flags-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Financial-Times/next-flags-api/labels{/name}","releases_url":"https://api.github.com/repos/Financial-Times/next-flags-api/releases{/id}","deployments_url":"https://api.github.com/repos/Financial-Times/next-flags-api/deployments","created_at":"2015-08-25T13:03:26Z","updated_at":"2016-02-01T09:51:23Z","pushed_at":"2016-04-18T17:00:01Z","git_url":"git://github.com/Financial-Times/next-flags-api.git","ssh_url":"git@github.com:Financial-Times/next-flags-api.git","clone_url":"https://github.com/Financial-Times/next-flags-api.git","svn_url":"https://github.com/Financial-Times/next-flags-api","homepage":null,"size":108,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":7,"forks":0,"open_issues":7,"watchers":0,"default_branch":"master"}},"base":{"label":"Financial-Times:master","ref":"master","sha":"713f5352370015f5c624ef9cdf70e2050cf17a1a","user":{"login":"Financial-Times","id":3502508,"avatar_url":"https://avatars.githubusercontent.com/u/3502508?v=3","gravatar_id":"","url":"https://api.github.com/users/Financial-Times","html_url":"https://github.com/Financial-Times","followers_url":"https://api.github.com/users/Financial-Times/followers","following_url":"https://api.github.com/users/Financial-Times/following{/other_user}","gists_url":"https://api.github.com/users/Financial-Times/gists{/gist_id}","starred_url":"https://api.github.com/users/Financial-Times/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Financial-Times/subscriptions","organizations_url":"https://api.github.com/users/Financial-Times/orgs","repos_url":"https://api.github.com/users/Financial-Times/repos","events_url":"https://api.github.com/users/Financial-Times/events{/privacy}","received_events_url":"https://api.github.com/users/Financial-Times/received_events","type":"Organization","site_admin":false},"repo":{"id":41363660,"name":"next-flags-api","full_name":"Financial-Times/next-flags-api","owner":{"login":"Financial-Times","id":3502508,"avatar_url":"https://avatars.githubusercontent.com/u/3502508?v=3","gravatar_id":"","url":"https://api.github.com/users/Financial-Times","html_url":"https://github.com/Financial-Times","followers_url":"https://api.github.com/users/Financial-Times/followers","following_url":"https://api.github.com/users/Financial-Times/following{/other_user}","gists_url":"https://api.github.com/users/Financial-Times/gists{/gist_id}","starred_url":"https://api.github.com/users/Financial-Times/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Financial-Times/subscriptions","organizations_url":"https://api.github.com/users/Financial-Times/orgs","repos_url":"https://api.github.com/users/Financial-Times/repos","events_url":"https://api.github.com/users/Financial-Times/events{/privacy}","received_events_url":"https://api.github.com/users/Financial-Times/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Financial-Times/next-flags-api","description":"New Flags API","fork":false,"url":"https://api.github.com/repos/Financial-Times/next-flags-api","forks_url":"https://api.github.com/repos/Financial-Times/next-flags-api/forks","keys_url":"https://api.github.com/repos/Financial-Times/next-flags-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Financial-Times/next-flags-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Financial-Times/next-flags-api/teams","hooks_url":"https://api.github.com/repos/Financial-Times/next-flags-api/hooks","issue_events_url":"https://api.github.com/repos/Financial-Times/next-flags-api/issues/events{/number}","events_url":"https://api.github.com/repos/Financial-Times/next-flags-api/events","assignees_url":"https://api.github.com/repos/Financial-Times/next-flags-api/assignees{/user}","branches_url":"https://api.github.com/repos/Financial-Times/next-flags-api/branches{/branch}","tags_url":"https://api.github.com/repos/Financial-Times/next-flags-api/tags","blobs_url":"https://api.github.com/repos/Financial-Times/next-flags-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Financial-Times/next-flags-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Financial-Times/next-flags-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/Financial-Times/next-flags-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Financial-Times/next-flags-api/statuses/{sha}","languages_url":"https://api.github.com/repos/Financial-Times/next-flags-api/languages","stargazers_url":"https://api.github.com/repos/Financial-Times/next-flags-api/stargazers","contributors_url":"https://api.github.com/repos/Financial-Times/next-flags-api/contributors","subscribers_url":"https://api.github.com/repos/Financial-Times/next-flags-api/subscribers","subscription_url":"https://api.github.com/repos/Financial-Times/next-flags-api/subscription","commits_url":"https://api.github.com/repos/Financial-Times/next-flags-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/Financial-Times/next-flags-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/Financial-Times/next-flags-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/Financial-Times/next-flags-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/Financial-Times/next-flags-api/contents/{+path}","compare_url":"https://api.github.com/repos/Financial-Times/next-flags-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Financial-Times/next-flags-api/merges","archive_url":"https://api.github.com/repos/Financial-Times/next-flags-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Financial-Times/next-flags-api/downloads","issues_url":"https://api.github.com/repos/Financial-Times/next-flags-api/issues{/number}","pulls_url":"https://api.github.com/repos/Financial-Times/next-flags-api/pulls{/number}","milestones_url":"https://api.github.com/repos/Financial-Times/next-flags-api/milestones{/number}","notifications_url":"https://api.github.com/repos/Financial-Times/next-flags-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Financial-Times/next-flags-api/labels{/name}","releases_url":"https://api.github.com/repos/Financial-Times/next-flags-api/releases{/id}","deployments_url":"https://api.github.com/repos/Financial-Times/next-flags-api/deployments","created_at":"2015-08-25T13:03:26Z","updated_at":"2016-02-01T09:51:23Z","pushed_at":"2016-04-18T17:00:01Z","git_url":"git://github.com/Financial-Times/next-flags-api.git","ssh_url":"git@github.com:Financial-Times/next-flags-api.git","clone_url":"https://github.com/Financial-Times/next-flags-api.git","svn_url":"https://github.com/Financial-Times/next-flags-api","homepage":null,"size":108,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":7,"forks":0,"open_issues":7,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Financial-Times/next-flags-api/pulls/47"},"html":{"href":"https://github.com/Financial-Times/next-flags-api/pull/47"},"issue":{"href":"https://api.github.com/repos/Financial-Times/next-flags-api/issues/47"},"comments":{"href":"https://api.github.com/repos/Financial-Times/next-flags-api/issues/47/comments"},"review_comments":{"href":"https://api.github.com/repos/Financial-Times/next-flags-api/pulls/47/comments"},"review_comment":{"href":"https://api.github.com/repos/Financial-Times/next-flags-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Financial-Times/next-flags-api/pulls/47/commits"},"statuses":{"href":"https://api.github.com/repos/Financial-Times/next-flags-api/statuses/0989bfff6034877d42c400c0e93a41a1053150e0"}}}}