{"action":"created","comment":{"url":"https://api.github.com/repos/couchbase/sync_gateway/pulls/comments/36323997","id":36323997,"diff_hunk":"@@ -373,7 +373,11 @@ func (h *handler) handleBulkDocs() error {\n \t\tnewEdits = true\n \t}\n \n-\tdocs := body[\"docs\"].([]interface{})\n+\tdocs, ok := body[\"docs\"].([]interface{})\n+\tif !ok {\n+\t\terr = base.HTTPErrorf(http.StatusBadRequest, \"Bad docs\")","path":"src/github.com/couchbase/sync_gateway/rest/bulk_api.go","position":7,"original_position":7,"commit_id":"2d45ef325a05e6914a7abed0122709f5d89e8dc4","original_commit_id":"2d45ef325a05e6914a7abed0122709f5d89e8dc4","user":{"login":"adamcfraser","id":8866453,"avatar_url":"https://avatars.githubusercontent.com/u/8866453?v=3","gravatar_id":"","url":"https://api.github.com/users/adamcfraser","html_url":"https://github.com/adamcfraser","followers_url":"https://api.github.com/users/adamcfraser/followers","following_url":"https://api.github.com/users/adamcfraser/following{/other_user}","gists_url":"https://api.github.com/users/adamcfraser/gists{/gist_id}","starred_url":"https://api.github.com/users/adamcfraser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamcfraser/subscriptions","organizations_url":"https://api.github.com/users/adamcfraser/orgs","repos_url":"https://api.github.com/users/adamcfraser/repos","events_url":"https://api.github.com/users/adamcfraser/events{/privacy}","received_events_url":"https://api.github.com/users/adamcfraser/received_events","type":"User","site_admin":false},"body":"Can we add a bit more detail to the error message, since it's user-facing?  ","created_at":"2015-08-05T16:43:53Z","updated_at":"2015-08-05T16:43:53Z","html_url":"https://github.com/couchbase/sync_gateway/pull/1032#discussion_r36323997","pull_request_url":"https://api.github.com/repos/couchbase/sync_gateway/pulls/1032","_links":{"self":{"href":"https://api.github.com/repos/couchbase/sync_gateway/pulls/comments/36323997"},"html":{"href":"https://github.com/couchbase/sync_gateway/pull/1032#discussion_r36323997"},"pull_request":{"href":"https://api.github.com/repos/couchbase/sync_gateway/pulls/1032"}}},"pull_request":{"url":"https://api.github.com/repos/couchbase/sync_gateway/pulls/1032","id":41694085,"html_url":"https://github.com/couchbase/sync_gateway/pull/1032","diff_url":"https://github.com/couchbase/sync_gateway/pull/1032.diff","patch_url":"https://github.com/couchbase/sync_gateway/pull/1032.patch","issue_url":"https://api.github.com/repos/couchbase/sync_gateway/issues/1032","number":1032,"state":"open","locked":false,"title":"Prevents panic if empty JSON passed to _bulk_docs","user":{"login":"ajres","id":7745210,"avatar_url":"https://avatars.githubusercontent.com/u/7745210?v=3","gravatar_id":"","url":"https://api.github.com/users/ajres","html_url":"https://github.com/ajres","followers_url":"https://api.github.com/users/ajres/followers","following_url":"https://api.github.com/users/ajres/following{/other_user}","gists_url":"https://api.github.com/users/ajres/gists{/gist_id}","starred_url":"https://api.github.com/users/ajres/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajres/subscriptions","organizations_url":"https://api.github.com/users/ajres/orgs","repos_url":"https://api.github.com/users/ajres/repos","events_url":"https://api.github.com/users/ajres/events{/privacy}","received_events_url":"https://api.github.com/users/ajres/received_events","type":"User","site_admin":false},"body":"Fixes #1027 ","created_at":"2015-08-05T15:47:42Z","updated_at":"2015-08-05T16:43:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f42258976fa82fac849ec2ba9846cac55c2e87b9","assignee":{"login":"adamcfraser","id":8866453,"avatar_url":"https://avatars.githubusercontent.com/u/8866453?v=3","gravatar_id":"","url":"https://api.github.com/users/adamcfraser","html_url":"https://github.com/adamcfraser","followers_url":"https://api.github.com/users/adamcfraser/followers","following_url":"https://api.github.com/users/adamcfraser/following{/other_user}","gists_url":"https://api.github.com/users/adamcfraser/gists{/gist_id}","starred_url":"https://api.github.com/users/adamcfraser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamcfraser/subscriptions","organizations_url":"https://api.github.com/users/adamcfraser/orgs","repos_url":"https://api.github.com/users/adamcfraser/repos","events_url":"https://api.github.com/users/adamcfraser/events{/privacy}","received_events_url":"https://api.github.com/users/adamcfraser/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/couchbase/sync_gateway/pulls/1032/commits","review_comments_url":"https://api.github.com/repos/couchbase/sync_gateway/pulls/1032/comments","review_comment_url":"https://api.github.com/repos/couchbase/sync_gateway/pulls/comments{/number}","comments_url":"https://api.github.com/repos/couchbase/sync_gateway/issues/1032/comments","statuses_url":"https://api.github.com/repos/couchbase/sync_gateway/statuses/2d45ef325a05e6914a7abed0122709f5d89e8dc4","head":{"label":"couchbase:feature/issue_1027","ref":"feature/issue_1027","sha":"2d45ef325a05e6914a7abed0122709f5d89e8dc4","user":{"login":"couchbase","id":605755,"avatar_url":"https://avatars.githubusercontent.com/u/605755?v=3","gravatar_id":"","url":"https://api.github.com/users/couchbase","html_url":"https://github.com/couchbase","followers_url":"https://api.github.com/users/couchbase/followers","following_url":"https://api.github.com/users/couchbase/following{/other_user}","gists_url":"https://api.github.com/users/couchbase/gists{/gist_id}","starred_url":"https://api.github.com/users/couchbase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/couchbase/subscriptions","organizations_url":"https://api.github.com/users/couchbase/orgs","repos_url":"https://api.github.com/users/couchbase/repos","events_url":"https://api.github.com/users/couchbase/events{/privacy}","received_events_url":"https://api.github.com/users/couchbase/received_events","type":"Organization","site_admin":false},"repo":{"id":6082996,"name":"sync_gateway","full_name":"couchbase/sync_gateway","owner":{"login":"couchbase","id":605755,"avatar_url":"https://avatars.githubusercontent.com/u/605755?v=3","gravatar_id":"","url":"https://api.github.com/users/couchbase","html_url":"https://github.com/couchbase","followers_url":"https://api.github.com/users/couchbase/followers","following_url":"https://api.github.com/users/couchbase/following{/other_user}","gists_url":"https://api.github.com/users/couchbase/gists{/gist_id}","starred_url":"https://api.github.com/users/couchbase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/couchbase/subscriptions","organizations_url":"https://api.github.com/users/couchbase/orgs","repos_url":"https://api.github.com/users/couchbase/repos","events_url":"https://api.github.com/users/couchbase/events{/privacy}","received_events_url":"https://api.github.com/users/couchbase/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/couchbase/sync_gateway","description":"Connects Couchbase Lite to Couchbase Server","fork":false,"url":"https://api.github.com/repos/couchbase/sync_gateway","forks_url":"https://api.github.com/repos/couchbase/sync_gateway/forks","keys_url":"https://api.github.com/repos/couchbase/sync_gateway/keys{/key_id}","collaborators_url":"https://api.github.com/repos/couchbase/sync_gateway/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/couchbase/sync_gateway/teams","hooks_url":"https://api.github.com/repos/couchbase/sync_gateway/hooks","issue_events_url":"https://api.github.com/repos/couchbase/sync_gateway/issues/events{/number}","events_url":"https://api.github.com/repos/couchbase/sync_gateway/events","assignees_url":"https://api.github.com/repos/couchbase/sync_gateway/assignees{/user}","branches_url":"https://api.github.com/repos/couchbase/sync_gateway/branches{/branch}","tags_url":"https://api.github.com/repos/couchbase/sync_gateway/tags","blobs_url":"https://api.github.com/repos/couchbase/sync_gateway/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/couchbase/sync_gateway/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/couchbase/sync_gateway/git/refs{/sha}","trees_url":"https://api.github.com/repos/couchbase/sync_gateway/git/trees{/sha}","statuses_url":"https://api.github.com/repos/couchbase/sync_gateway/statuses/{sha}","languages_url":"https://api.github.com/repos/couchbase/sync_gateway/languages","stargazers_url":"https://api.github.com/repos/couchbase/sync_gateway/stargazers","contributors_url":"https://api.github.com/repos/couchbase/sync_gateway/contributors","subscribers_url":"https://api.github.com/repos/couchbase/sync_gateway/subscribers","subscription_url":"https://api.github.com/repos/couchbase/sync_gateway/subscription","commits_url":"https://api.github.com/repos/couchbase/sync_gateway/commits{/sha}","git_commits_url":"https://api.github.com/repos/couchbase/sync_gateway/git/commits{/sha}","comments_url":"https://api.github.com/repos/couchbase/sync_gateway/comments{/number}","issue_comment_url":"https://api.github.com/repos/couchbase/sync_gateway/issues/comments{/number}","contents_url":"https://api.github.com/repos/couchbase/sync_gateway/contents/{+path}","compare_url":"https://api.github.com/repos/couchbase/sync_gateway/compare/{base}...{head}","merges_url":"https://api.github.com/repos/couchbase/sync_gateway/merges","archive_url":"https://api.github.com/repos/couchbase/sync_gateway/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/couchbase/sync_gateway/downloads","issues_url":"https://api.github.com/repos/couchbase/sync_gateway/issues{/number}","pulls_url":"https://api.github.com/repos/couchbase/sync_gateway/pulls{/number}","milestones_url":"https://api.github.com/repos/couchbase/sync_gateway/milestones{/number}","notifications_url":"https://api.github.com/repos/couchbase/sync_gateway/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/couchbase/sync_gateway/labels{/name}","releases_url":"https://api.github.com/repos/couchbase/sync_gateway/releases{/id}","created_at":"2012-10-04T22:25:43Z","updated_at":"2015-08-04T22:22:54Z","pushed_at":"2015-08-05T15:47:43Z","git_url":"git://github.com/couchbase/sync_gateway.git","ssh_url":"git@github.com:couchbase/sync_gateway.git","clone_url":"https://github.com/couchbase/sync_gateway.git","svn_url":"https://github.com/couchbase/sync_gateway","homepage":"","size":16019,"stargazers_count":180,"watchers_count":180,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":63,"mirror_url":null,"open_issues_count":218,"forks":63,"open_issues":218,"watchers":180,"default_branch":"master"}},"base":{"label":"couchbase:master","ref":"master","sha":"cdb5ed3afddcec1115eb730b95a1f1449a8e50bf","user":{"login":"couchbase","id":605755,"avatar_url":"https://avatars.githubusercontent.com/u/605755?v=3","gravatar_id":"","url":"https://api.github.com/users/couchbase","html_url":"https://github.com/couchbase","followers_url":"https://api.github.com/users/couchbase/followers","following_url":"https://api.github.com/users/couchbase/following{/other_user}","gists_url":"https://api.github.com/users/couchbase/gists{/gist_id}","starred_url":"https://api.github.com/users/couchbase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/couchbase/subscriptions","organizations_url":"https://api.github.com/users/couchbase/orgs","repos_url":"https://api.github.com/users/couchbase/repos","events_url":"https://api.github.com/users/couchbase/events{/privacy}","received_events_url":"https://api.github.com/users/couchbase/received_events","type":"Organization","site_admin":false},"repo":{"id":6082996,"name":"sync_gateway","full_name":"couchbase/sync_gateway","owner":{"login":"couchbase","id":605755,"avatar_url":"https://avatars.githubusercontent.com/u/605755?v=3","gravatar_id":"","url":"https://api.github.com/users/couchbase","html_url":"https://github.com/couchbase","followers_url":"https://api.github.com/users/couchbase/followers","following_url":"https://api.github.com/users/couchbase/following{/other_user}","gists_url":"https://api.github.com/users/couchbase/gists{/gist_id}","starred_url":"https://api.github.com/users/couchbase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/couchbase/subscriptions","organizations_url":"https://api.github.com/users/couchbase/orgs","repos_url":"https://api.github.com/users/couchbase/repos","events_url":"https://api.github.com/users/couchbase/events{/privacy}","received_events_url":"https://api.github.com/users/couchbase/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/couchbase/sync_gateway","description":"Connects Couchbase Lite to Couchbase Server","fork":false,"url":"https://api.github.com/repos/couchbase/sync_gateway","forks_url":"https://api.github.com/repos/couchbase/sync_gateway/forks","keys_url":"https://api.github.com/repos/couchbase/sync_gateway/keys{/key_id}","collaborators_url":"https://api.github.com/repos/couchbase/sync_gateway/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/couchbase/sync_gateway/teams","hooks_url":"https://api.github.com/repos/couchbase/sync_gateway/hooks","issue_events_url":"https://api.github.com/repos/couchbase/sync_gateway/issues/events{/number}","events_url":"https://api.github.com/repos/couchbase/sync_gateway/events","assignees_url":"https://api.github.com/repos/couchbase/sync_gateway/assignees{/user}","branches_url":"https://api.github.com/repos/couchbase/sync_gateway/branches{/branch}","tags_url":"https://api.github.com/repos/couchbase/sync_gateway/tags","blobs_url":"https://api.github.com/repos/couchbase/sync_gateway/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/couchbase/sync_gateway/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/couchbase/sync_gateway/git/refs{/sha}","trees_url":"https://api.github.com/repos/couchbase/sync_gateway/git/trees{/sha}","statuses_url":"https://api.github.com/repos/couchbase/sync_gateway/statuses/{sha}","languages_url":"https://api.github.com/repos/couchbase/sync_gateway/languages","stargazers_url":"https://api.github.com/repos/couchbase/sync_gateway/stargazers","contributors_url":"https://api.github.com/repos/couchbase/sync_gateway/contributors","subscribers_url":"https://api.github.com/repos/couchbase/sync_gateway/subscribers","subscription_url":"https://api.github.com/repos/couchbase/sync_gateway/subscription","commits_url":"https://api.github.com/repos/couchbase/sync_gateway/commits{/sha}","git_commits_url":"https://api.github.com/repos/couchbase/sync_gateway/git/commits{/sha}","comments_url":"https://api.github.com/repos/couchbase/sync_gateway/comments{/number}","issue_comment_url":"https://api.github.com/repos/couchbase/sync_gateway/issues/comments{/number}","contents_url":"https://api.github.com/repos/couchbase/sync_gateway/contents/{+path}","compare_url":"https://api.github.com/repos/couchbase/sync_gateway/compare/{base}...{head}","merges_url":"https://api.github.com/repos/couchbase/sync_gateway/merges","archive_url":"https://api.github.com/repos/couchbase/sync_gateway/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/couchbase/sync_gateway/downloads","issues_url":"https://api.github.com/repos/couchbase/sync_gateway/issues{/number}","pulls_url":"https://api.github.com/repos/couchbase/sync_gateway/pulls{/number}","milestones_url":"https://api.github.com/repos/couchbase/sync_gateway/milestones{/number}","notifications_url":"https://api.github.com/repos/couchbase/sync_gateway/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/couchbase/sync_gateway/labels{/name}","releases_url":"https://api.github.com/repos/couchbase/sync_gateway/releases{/id}","created_at":"2012-10-04T22:25:43Z","updated_at":"2015-08-04T22:22:54Z","pushed_at":"2015-08-05T15:47:43Z","git_url":"git://github.com/couchbase/sync_gateway.git","ssh_url":"git@github.com:couchbase/sync_gateway.git","clone_url":"https://github.com/couchbase/sync_gateway.git","svn_url":"https://github.com/couchbase/sync_gateway","homepage":"","size":16019,"stargazers_count":180,"watchers_count":180,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":63,"mirror_url":null,"open_issues_count":218,"forks":63,"open_issues":218,"watchers":180,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/couchbase/sync_gateway/pulls/1032"},"html":{"href":"https://github.com/couchbase/sync_gateway/pull/1032"},"issue":{"href":"https://api.github.com/repos/couchbase/sync_gateway/issues/1032"},"comments":{"href":"https://api.github.com/repos/couchbase/sync_gateway/issues/1032/comments"},"review_comments":{"href":"https://api.github.com/repos/couchbase/sync_gateway/pulls/1032/comments"},"review_comment":{"href":"https://api.github.com/repos/couchbase/sync_gateway/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/couchbase/sync_gateway/pulls/1032/commits"},"statuses":{"href":"https://api.github.com/repos/couchbase/sync_gateway/statuses/2d45ef325a05e6914a7abed0122709f5d89e8dc4"}}}}