{"action":"closed","number":120,"pull_request":{"url":"https://api.github.com/repos/rmosolgo/graphql-ruby/pulls/120","id":63975523,"html_url":"https://github.com/rmosolgo/graphql-ruby/pull/120","diff_url":"https://github.com/rmosolgo/graphql-ruby/pull/120.diff","patch_url":"https://github.com/rmosolgo/graphql-ruby/pull/120.patch","issue_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/issues/120","number":120,"state":"closed","locked":false,"title":"Avoid providing internal server error messages to clients.","user":{"login":"dylanahsmith","id":954402,"avatar_url":"https://avatars.githubusercontent.com/u/954402?v=3","gravatar_id":"","url":"https://api.github.com/users/dylanahsmith","html_url":"https://github.com/dylanahsmith","followers_url":"https://api.github.com/users/dylanahsmith/followers","following_url":"https://api.github.com/users/dylanahsmith/following{/other_user}","gists_url":"https://api.github.com/users/dylanahsmith/gists{/gist_id}","starred_url":"https://api.github.com/users/dylanahsmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dylanahsmith/subscriptions","organizations_url":"https://api.github.com/users/dylanahsmith/orgs","repos_url":"https://api.github.com/users/dylanahsmith/repos","events_url":"https://api.github.com/users/dylanahsmith/events{/privacy}","received_events_url":"https://api.github.com/users/dylanahsmith/received_events","type":"User","site_admin":false},"body":"## Problem\r\n\r\nThis gem would send standard errors to clients, which could include sensitive information.  For example, when using the mysql2 gem, the error message could include the database query.\r\n\r\nIronically, we have been using the `debug: true` option to both hide the internal error messages and get access to the full error information for logging and for error reporting.  I would like to get rid of that hack.\r\n\r\n## Solution\r\n\r\nUse `\"Internal error\"` as the error message for standard errors.  ExecutionError should be used to report client errors.\r\n\r\nAlso, add the error to `query.context.errors` for logging and error reporting.\r\n\r\nI also used an ExecutionError for OperationNameMissingError since I didn't want it to be treated as an internal error.  I also changed ExecutionError.to_h to omit the locations key so OperationNameMissingError continues to get rendered properly, and because there doesn't seem to be any reason to include the locations key when there is no location information for the error.","created_at":"2016-03-24T00:48:25Z","updated_at":"2016-03-24T13:55:30Z","closed_at":"2016-03-24T13:55:30Z","merged_at":"2016-03-24T13:55:30Z","merge_commit_sha":"066736529cd3a859d8425a2526edcc4ca50794a3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/pulls/120/commits","review_comments_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/pulls/120/comments","review_comment_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/issues/120/comments","statuses_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/statuses/80b9c4413433c25b3a74044ee7e5d821ecfd8033","head":{"label":"dylanahsmith:internal-errors","ref":"internal-errors","sha":"80b9c4413433c25b3a74044ee7e5d821ecfd8033","user":{"login":"dylanahsmith","id":954402,"avatar_url":"https://avatars.githubusercontent.com/u/954402?v=3","gravatar_id":"","url":"https://api.github.com/users/dylanahsmith","html_url":"https://github.com/dylanahsmith","followers_url":"https://api.github.com/users/dylanahsmith/followers","following_url":"https://api.github.com/users/dylanahsmith/following{/other_user}","gists_url":"https://api.github.com/users/dylanahsmith/gists{/gist_id}","starred_url":"https://api.github.com/users/dylanahsmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dylanahsmith/subscriptions","organizations_url":"https://api.github.com/users/dylanahsmith/orgs","repos_url":"https://api.github.com/users/dylanahsmith/repos","events_url":"https://api.github.com/users/dylanahsmith/events{/privacy}","received_events_url":"https://api.github.com/users/dylanahsmith/received_events","type":"User","site_admin":false},"repo":{"id":42741677,"name":"graphql-ruby","full_name":"dylanahsmith/graphql-ruby","owner":{"login":"dylanahsmith","id":954402,"avatar_url":"https://avatars.githubusercontent.com/u/954402?v=3","gravatar_id":"","url":"https://api.github.com/users/dylanahsmith","html_url":"https://github.com/dylanahsmith","followers_url":"https://api.github.com/users/dylanahsmith/followers","following_url":"https://api.github.com/users/dylanahsmith/following{/other_user}","gists_url":"https://api.github.com/users/dylanahsmith/gists{/gist_id}","starred_url":"https://api.github.com/users/dylanahsmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dylanahsmith/subscriptions","organizations_url":"https://api.github.com/users/dylanahsmith/orgs","repos_url":"https://api.github.com/users/dylanahsmith/repos","events_url":"https://api.github.com/users/dylanahsmith/events{/privacy}","received_events_url":"https://api.github.com/users/dylanahsmith/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dylanahsmith/graphql-ruby","description":"Ruby implementation of Facebook's GraphQL ","fork":true,"url":"https://api.github.com/repos/dylanahsmith/graphql-ruby","forks_url":"https://api.github.com/repos/dylanahsmith/graphql-ruby/forks","keys_url":"https://api.github.com/repos/dylanahsmith/graphql-ruby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dylanahsmith/graphql-ruby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dylanahsmith/graphql-ruby/teams","hooks_url":"https://api.github.com/repos/dylanahsmith/graphql-ruby/hooks","issue_events_url":"https://api.github.com/repos/dylanahsmith/graphql-ruby/issues/events{/number}","events_url":"https://api.github.com/repos/dylanahsmith/graphql-ruby/events","assignees_url":"https://api.github.com/repos/dylanahsmith/graphql-ruby/assignees{/user}","branches_url":"https://api.github.com/repos/dylanahsmith/graphql-ruby/branches{/branch}","tags_url":"https://api.github.com/repos/dylanahsmith/graphql-ruby/tags","blobs_url":"https://api.github.com/repos/dylanahsmith/graphql-ruby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dylanahsmith/graphql-ruby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dylanahsmith/graphql-ruby/git/refs{/sha}","trees_url":"https://api.github.com/repos/dylanahsmith/graphql-ruby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dylanahsmith/graphql-ruby/statuses/{sha}","languages_url":"https://api.github.com/repos/dylanahsmith/graphql-ruby/languages","stargazers_url":"https://api.github.com/repos/dylanahsmith/graphql-ruby/stargazers","contributors_url":"https://api.github.com/repos/dylanahsmith/graphql-ruby/contributors","subscribers_url":"https://api.github.com/repos/dylanahsmith/graphql-ruby/subscribers","subscription_url":"https://api.github.com/repos/dylanahsmith/graphql-ruby/subscription","commits_url":"https://api.github.com/repos/dylanahsmith/graphql-ruby/commits{/sha}","git_commits_url":"https://api.github.com/repos/dylanahsmith/graphql-ruby/git/commits{/sha}","comments_url":"https://api.github.com/repos/dylanahsmith/graphql-ruby/comments{/number}","issue_comment_url":"https://api.github.com/repos/dylanahsmith/graphql-ruby/issues/comments{/number}","contents_url":"https://api.github.com/repos/dylanahsmith/graphql-ruby/contents/{+path}","compare_url":"https://api.github.com/repos/dylanahsmith/graphql-ruby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dylanahsmith/graphql-ruby/merges","archive_url":"https://api.github.com/repos/dylanahsmith/graphql-ruby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dylanahsmith/graphql-ruby/downloads","issues_url":"https://api.github.com/repos/dylanahsmith/graphql-ruby/issues{/number}","pulls_url":"https://api.github.com/repos/dylanahsmith/graphql-ruby/pulls{/number}","milestones_url":"https://api.github.com/repos/dylanahsmith/graphql-ruby/milestones{/number}","notifications_url":"https://api.github.com/repos/dylanahsmith/graphql-ruby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dylanahsmith/graphql-ruby/labels{/name}","releases_url":"https://api.github.com/repos/dylanahsmith/graphql-ruby/releases{/id}","deployments_url":"https://api.github.com/repos/dylanahsmith/graphql-ruby/deployments","created_at":"2015-09-18T18:59:44Z","updated_at":"2015-09-18T18:59:45Z","pushed_at":"2016-03-24T00:36:11Z","git_url":"git://github.com/dylanahsmith/graphql-ruby.git","ssh_url":"git@github.com:dylanahsmith/graphql-ruby.git","clone_url":"https://github.com/dylanahsmith/graphql-ruby.git","svn_url":"https://github.com/dylanahsmith/graphql-ruby","homepage":"","size":950,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rmosolgo:master","ref":"master","sha":"17deaa20a948deccf178f6a7ca5c8ea931985cf5","user":{"login":"rmosolgo","id":2231765,"avatar_url":"https://avatars.githubusercontent.com/u/2231765?v=3","gravatar_id":"","url":"https://api.github.com/users/rmosolgo","html_url":"https://github.com/rmosolgo","followers_url":"https://api.github.com/users/rmosolgo/followers","following_url":"https://api.github.com/users/rmosolgo/following{/other_user}","gists_url":"https://api.github.com/users/rmosolgo/gists{/gist_id}","starred_url":"https://api.github.com/users/rmosolgo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmosolgo/subscriptions","organizations_url":"https://api.github.com/users/rmosolgo/orgs","repos_url":"https://api.github.com/users/rmosolgo/repos","events_url":"https://api.github.com/users/rmosolgo/events{/privacy}","received_events_url":"https://api.github.com/users/rmosolgo/received_events","type":"User","site_admin":false},"repo":{"id":30337170,"name":"graphql-ruby","full_name":"rmosolgo/graphql-ruby","owner":{"login":"rmosolgo","id":2231765,"avatar_url":"https://avatars.githubusercontent.com/u/2231765?v=3","gravatar_id":"","url":"https://api.github.com/users/rmosolgo","html_url":"https://github.com/rmosolgo","followers_url":"https://api.github.com/users/rmosolgo/followers","following_url":"https://api.github.com/users/rmosolgo/following{/other_user}","gists_url":"https://api.github.com/users/rmosolgo/gists{/gist_id}","starred_url":"https://api.github.com/users/rmosolgo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmosolgo/subscriptions","organizations_url":"https://api.github.com/users/rmosolgo/orgs","repos_url":"https://api.github.com/users/rmosolgo/repos","events_url":"https://api.github.com/users/rmosolgo/events{/privacy}","received_events_url":"https://api.github.com/users/rmosolgo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rmosolgo/graphql-ruby","description":"Ruby implementation of Facebook's GraphQL ","fork":false,"url":"https://api.github.com/repos/rmosolgo/graphql-ruby","forks_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/forks","keys_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/teams","hooks_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/hooks","issue_events_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/issues/events{/number}","events_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/events","assignees_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/assignees{/user}","branches_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/branches{/branch}","tags_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/tags","blobs_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/git/refs{/sha}","trees_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/statuses/{sha}","languages_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/languages","stargazers_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/stargazers","contributors_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/contributors","subscribers_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/subscribers","subscription_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/subscription","commits_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/commits{/sha}","git_commits_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/git/commits{/sha}","comments_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/comments{/number}","issue_comment_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/issues/comments{/number}","contents_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/contents/{+path}","compare_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/merges","archive_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/downloads","issues_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/issues{/number}","pulls_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/pulls{/number}","milestones_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/milestones{/number}","notifications_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/labels{/name}","releases_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/releases{/id}","deployments_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/deployments","created_at":"2015-02-05T04:11:22Z","updated_at":"2016-03-24T02:42:43Z","pushed_at":"2016-03-24T13:55:30Z","git_url":"git://github.com/rmosolgo/graphql-ruby.git","ssh_url":"git@github.com:rmosolgo/graphql-ruby.git","clone_url":"https://github.com/rmosolgo/graphql-ruby.git","svn_url":"https://github.com/rmosolgo/graphql-ruby","homepage":"","size":1022,"stargazers_count":645,"watchers_count":645,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":52,"mirror_url":null,"open_issues_count":8,"forks":52,"open_issues":8,"watchers":645,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rmosolgo/graphql-ruby/pulls/120"},"html":{"href":"https://github.com/rmosolgo/graphql-ruby/pull/120"},"issue":{"href":"https://api.github.com/repos/rmosolgo/graphql-ruby/issues/120"},"comments":{"href":"https://api.github.com/repos/rmosolgo/graphql-ruby/issues/120/comments"},"review_comments":{"href":"https://api.github.com/repos/rmosolgo/graphql-ruby/pulls/120/comments"},"review_comment":{"href":"https://api.github.com/repos/rmosolgo/graphql-ruby/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rmosolgo/graphql-ruby/pulls/120/commits"},"statuses":{"href":"https://api.github.com/repos/rmosolgo/graphql-ruby/statuses/80b9c4413433c25b3a74044ee7e5d821ecfd8033"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"rmosolgo","id":2231765,"avatar_url":"https://avatars.githubusercontent.com/u/2231765?v=3","gravatar_id":"","url":"https://api.github.com/users/rmosolgo","html_url":"https://github.com/rmosolgo","followers_url":"https://api.github.com/users/rmosolgo/followers","following_url":"https://api.github.com/users/rmosolgo/following{/other_user}","gists_url":"https://api.github.com/users/rmosolgo/gists{/gist_id}","starred_url":"https://api.github.com/users/rmosolgo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmosolgo/subscriptions","organizations_url":"https://api.github.com/users/rmosolgo/orgs","repos_url":"https://api.github.com/users/rmosolgo/repos","events_url":"https://api.github.com/users/rmosolgo/events{/privacy}","received_events_url":"https://api.github.com/users/rmosolgo/received_events","type":"User","site_admin":false},"comments":0,"review_comments":1,"commits":1,"additions":12,"deletions":9,"changed_files":4}}