{"action":"created","comment":{"url":"https://api.github.com/repos/TuneLab/go-truss/pulls/comments/121827330","pull_request_review_id":43886691,"id":121827330,"diff_hunk":"@@ -188,7 +197,7 @@ func errorEncoder(_ context.Context, err error, w http.ResponseWriter) {\n }\n \n type errorWrapper struct {\n-\tError string ` + \"`json:\\\"error\\\"`\\n\" + `\n+\tError string ` + \"`\" + `json:\"error\"` + \"`\" + `","path":"gengokit/httptransport/templates/server.go","position":66,"original_position":66,"commit_id":"00c41b6abf5040208f92bdecdba4db44d4815864","original_commit_id":"00c41b6abf5040208f92bdecdba4db44d4815864","user":{"login":"hasIan","id":7491567,"avatar_url":"https://avatars2.githubusercontent.com/u/7491567?v=3","gravatar_id":"","url":"https://api.github.com/users/hasIan","html_url":"https://github.com/hasIan","followers_url":"https://api.github.com/users/hasIan/followers","following_url":"https://api.github.com/users/hasIan/following{/other_user}","gists_url":"https://api.github.com/users/hasIan/gists{/gist_id}","starred_url":"https://api.github.com/users/hasIan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hasIan/subscriptions","organizations_url":"https://api.github.com/users/hasIan/orgs","repos_url":"https://api.github.com/users/hasIan/repos","events_url":"https://api.github.com/users/hasIan/events{/privacy}","received_events_url":"https://api.github.com/users/hasIan/received_events","type":"User","site_admin":false},"body":"What is this struct-tag-looking construct? This is a template file, but I still don't understand this, or why it could not just be\r\n```\r\nError string `json:\"error\"`\r\n```","created_at":"2017-06-14T00:09:58Z","updated_at":"2017-06-14T00:20:11Z","html_url":"https://github.com/TuneLab/go-truss/pull/190#discussion_r121827330","pull_request_url":"https://api.github.com/repos/TuneLab/go-truss/pulls/190","_links":{"self":{"href":"https://api.github.com/repos/TuneLab/go-truss/pulls/comments/121827330"},"html":{"href":"https://github.com/TuneLab/go-truss/pull/190#discussion_r121827330"},"pull_request":{"href":"https://api.github.com/repos/TuneLab/go-truss/pulls/190"}}},"pull_request":{"url":"https://api.github.com/repos/TuneLab/go-truss/pulls/190","id":125263226,"html_url":"https://github.com/TuneLab/go-truss/pull/190","diff_url":"https://github.com/TuneLab/go-truss/pull/190.diff","patch_url":"https://github.com/TuneLab/go-truss/pull/190.patch","issue_url":"https://api.github.com/repos/TuneLab/go-truss/issues/190","number":190,"state":"open","locked":false,"title":"[MVS-117] Make errors more useful when receiving non-json requests/responses.","user":{"login":"adamryman","id":1024582,"avatar_url":"https://avatars2.githubusercontent.com/u/1024582?v=3","gravatar_id":"","url":"https://api.github.com/users/adamryman","html_url":"https://github.com/adamryman","followers_url":"https://api.github.com/users/adamryman/followers","following_url":"https://api.github.com/users/adamryman/following{/other_user}","gists_url":"https://api.github.com/users/adamryman/gists{/gist_id}","starred_url":"https://api.github.com/users/adamryman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamryman/subscriptions","organizations_url":"https://api.github.com/users/adamryman/orgs","repos_url":"https://api.github.com/users/adamryman/repos","events_url":"https://api.github.com/users/adamryman/events{/privacy}","received_events_url":"https://api.github.com/users/adamryman/received_events","type":"User","site_admin":false},"body":"Both truss servers and clients would just return unhelpful json decoding errors when decoding requests and responses respectively. \r\n\r\nThis PR has both put the body of the request/response into the error message if their body is not json. This is limited to 8KB so that if binary data is sent, these error messages will not be way too massive. \r\n\r\n- [X] Update client to put response body in error if it is not a json response\r\n    - [x] Test that response body is in the error\r\n    - [X] Limit to 8KB (8196 bytes)\r\n        - [x] Test with response body bigger than 8196 bytes.\r\n    - [X] Update error to have status code if it was not `200`\r\n- [X] Update server to put request body in error if the body is not json\r\n    - [x] Test that request body is in the error\r\n    - [X] Limit to 8KB (8196 bytes)\r\n        - [x] Test with request body bigger than 8196 bytes.\r\n- [X] Change server http response content type to `\"application/json; charset=utf-8\"`\r\n    - [x] Test http response content type","created_at":"2017-06-13T01:47:23Z","updated_at":"2017-06-14T00:20:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c28413734f1ffdca23239fdb3923ff6f52a49cee","assignee":null,"assignees":[],"requested_reviewers":[{"login":"zaquestion","id":2358914,"avatar_url":"https://avatars2.githubusercontent.com/u/2358914?v=3","gravatar_id":"","url":"https://api.github.com/users/zaquestion","html_url":"https://github.com/zaquestion","followers_url":"https://api.github.com/users/zaquestion/followers","following_url":"https://api.github.com/users/zaquestion/following{/other_user}","gists_url":"https://api.github.com/users/zaquestion/gists{/gist_id}","starred_url":"https://api.github.com/users/zaquestion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zaquestion/subscriptions","organizations_url":"https://api.github.com/users/zaquestion/orgs","repos_url":"https://api.github.com/users/zaquestion/repos","events_url":"https://api.github.com/users/zaquestion/events{/privacy}","received_events_url":"https://api.github.com/users/zaquestion/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/TuneLab/go-truss/pulls/190/commits","review_comments_url":"https://api.github.com/repos/TuneLab/go-truss/pulls/190/comments","review_comment_url":"https://api.github.com/repos/TuneLab/go-truss/pulls/comments{/number}","comments_url":"https://api.github.com/repos/TuneLab/go-truss/issues/190/comments","statuses_url":"https://api.github.com/repos/TuneLab/go-truss/statuses/00c41b6abf5040208f92bdecdba4db44d4815864","head":{"label":"adamryman:json_error_encoding","ref":"json_error_encoding","sha":"00c41b6abf5040208f92bdecdba4db44d4815864","user":{"login":"adamryman","id":1024582,"avatar_url":"https://avatars2.githubusercontent.com/u/1024582?v=3","gravatar_id":"","url":"https://api.github.com/users/adamryman","html_url":"https://github.com/adamryman","followers_url":"https://api.github.com/users/adamryman/followers","following_url":"https://api.github.com/users/adamryman/following{/other_user}","gists_url":"https://api.github.com/users/adamryman/gists{/gist_id}","starred_url":"https://api.github.com/users/adamryman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamryman/subscriptions","organizations_url":"https://api.github.com/users/adamryman/orgs","repos_url":"https://api.github.com/users/adamryman/repos","events_url":"https://api.github.com/users/adamryman/events{/privacy}","received_events_url":"https://api.github.com/users/adamryman/received_events","type":"User","site_admin":false},"repo":{"id":72152236,"name":"go-truss","full_name":"adamryman/go-truss","owner":{"login":"adamryman","id":1024582,"avatar_url":"https://avatars2.githubusercontent.com/u/1024582?v=3","gravatar_id":"","url":"https://api.github.com/users/adamryman","html_url":"https://github.com/adamryman","followers_url":"https://api.github.com/users/adamryman/followers","following_url":"https://api.github.com/users/adamryman/following{/other_user}","gists_url":"https://api.github.com/users/adamryman/gists{/gist_id}","starred_url":"https://api.github.com/users/adamryman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamryman/subscriptions","organizations_url":"https://api.github.com/users/adamryman/orgs","repos_url":"https://api.github.com/users/adamryman/repos","events_url":"https://api.github.com/users/adamryman/events{/privacy}","received_events_url":"https://api.github.com/users/adamryman/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/adamryman/go-truss","description":"Truss helps you build go-kit microservices without having to worry about writing or maintaining boilerplate code.","fork":true,"url":"https://api.github.com/repos/adamryman/go-truss","forks_url":"https://api.github.com/repos/adamryman/go-truss/forks","keys_url":"https://api.github.com/repos/adamryman/go-truss/keys{/key_id}","collaborators_url":"https://api.github.com/repos/adamryman/go-truss/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/adamryman/go-truss/teams","hooks_url":"https://api.github.com/repos/adamryman/go-truss/hooks","issue_events_url":"https://api.github.com/repos/adamryman/go-truss/issues/events{/number}","events_url":"https://api.github.com/repos/adamryman/go-truss/events","assignees_url":"https://api.github.com/repos/adamryman/go-truss/assignees{/user}","branches_url":"https://api.github.com/repos/adamryman/go-truss/branches{/branch}","tags_url":"https://api.github.com/repos/adamryman/go-truss/tags","blobs_url":"https://api.github.com/repos/adamryman/go-truss/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/adamryman/go-truss/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/adamryman/go-truss/git/refs{/sha}","trees_url":"https://api.github.com/repos/adamryman/go-truss/git/trees{/sha}","statuses_url":"https://api.github.com/repos/adamryman/go-truss/statuses/{sha}","languages_url":"https://api.github.com/repos/adamryman/go-truss/languages","stargazers_url":"https://api.github.com/repos/adamryman/go-truss/stargazers","contributors_url":"https://api.github.com/repos/adamryman/go-truss/contributors","subscribers_url":"https://api.github.com/repos/adamryman/go-truss/subscribers","subscription_url":"https://api.github.com/repos/adamryman/go-truss/subscription","commits_url":"https://api.github.com/repos/adamryman/go-truss/commits{/sha}","git_commits_url":"https://api.github.com/repos/adamryman/go-truss/git/commits{/sha}","comments_url":"https://api.github.com/repos/adamryman/go-truss/comments{/number}","issue_comment_url":"https://api.github.com/repos/adamryman/go-truss/issues/comments{/number}","contents_url":"https://api.github.com/repos/adamryman/go-truss/contents/{+path}","compare_url":"https://api.github.com/repos/adamryman/go-truss/compare/{base}...{head}","merges_url":"https://api.github.com/repos/adamryman/go-truss/merges","archive_url":"https://api.github.com/repos/adamryman/go-truss/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/adamryman/go-truss/downloads","issues_url":"https://api.github.com/repos/adamryman/go-truss/issues{/number}","pulls_url":"https://api.github.com/repos/adamryman/go-truss/pulls{/number}","milestones_url":"https://api.github.com/repos/adamryman/go-truss/milestones{/number}","notifications_url":"https://api.github.com/repos/adamryman/go-truss/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/adamryman/go-truss/labels{/name}","releases_url":"https://api.github.com/repos/adamryman/go-truss/releases{/id}","deployments_url":"https://api.github.com/repos/adamryman/go-truss/deployments","created_at":"2016-10-27T22:10:17Z","updated_at":"2016-10-27T22:10:20Z","pushed_at":"2017-06-13T22:26:44Z","git_url":"git://github.com/adamryman/go-truss.git","ssh_url":"git@github.com:adamryman/go-truss.git","clone_url":"https://github.com/adamryman/go-truss.git","svn_url":"https://github.com/adamryman/go-truss","homepage":"","size":10951,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"TuneLab:master","ref":"master","sha":"3eb5bdafb91538af9e918a4d71291af25926f0a7","user":{"login":"TuneLab","id":12895637,"avatar_url":"https://avatars2.githubusercontent.com/u/12895637?v=3","gravatar_id":"","url":"https://api.github.com/users/TuneLab","html_url":"https://github.com/TuneLab","followers_url":"https://api.github.com/users/TuneLab/followers","following_url":"https://api.github.com/users/TuneLab/following{/other_user}","gists_url":"https://api.github.com/users/TuneLab/gists{/gist_id}","starred_url":"https://api.github.com/users/TuneLab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TuneLab/subscriptions","organizations_url":"https://api.github.com/users/TuneLab/orgs","repos_url":"https://api.github.com/users/TuneLab/repos","events_url":"https://api.github.com/users/TuneLab/events{/privacy}","received_events_url":"https://api.github.com/users/TuneLab/received_events","type":"Organization","site_admin":false},"repo":{"id":61059364,"name":"go-truss","full_name":"TuneLab/go-truss","owner":{"login":"TuneLab","id":12895637,"avatar_url":"https://avatars2.githubusercontent.com/u/12895637?v=3","gravatar_id":"","url":"https://api.github.com/users/TuneLab","html_url":"https://github.com/TuneLab","followers_url":"https://api.github.com/users/TuneLab/followers","following_url":"https://api.github.com/users/TuneLab/following{/other_user}","gists_url":"https://api.github.com/users/TuneLab/gists{/gist_id}","starred_url":"https://api.github.com/users/TuneLab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TuneLab/subscriptions","organizations_url":"https://api.github.com/users/TuneLab/orgs","repos_url":"https://api.github.com/users/TuneLab/repos","events_url":"https://api.github.com/users/TuneLab/events{/privacy}","received_events_url":"https://api.github.com/users/TuneLab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/TuneLab/go-truss","description":"Truss helps you build go-kit microservices without having to worry about writing or maintaining boilerplate code.","fork":false,"url":"https://api.github.com/repos/TuneLab/go-truss","forks_url":"https://api.github.com/repos/TuneLab/go-truss/forks","keys_url":"https://api.github.com/repos/TuneLab/go-truss/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TuneLab/go-truss/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TuneLab/go-truss/teams","hooks_url":"https://api.github.com/repos/TuneLab/go-truss/hooks","issue_events_url":"https://api.github.com/repos/TuneLab/go-truss/issues/events{/number}","events_url":"https://api.github.com/repos/TuneLab/go-truss/events","assignees_url":"https://api.github.com/repos/TuneLab/go-truss/assignees{/user}","branches_url":"https://api.github.com/repos/TuneLab/go-truss/branches{/branch}","tags_url":"https://api.github.com/repos/TuneLab/go-truss/tags","blobs_url":"https://api.github.com/repos/TuneLab/go-truss/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TuneLab/go-truss/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TuneLab/go-truss/git/refs{/sha}","trees_url":"https://api.github.com/repos/TuneLab/go-truss/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TuneLab/go-truss/statuses/{sha}","languages_url":"https://api.github.com/repos/TuneLab/go-truss/languages","stargazers_url":"https://api.github.com/repos/TuneLab/go-truss/stargazers","contributors_url":"https://api.github.com/repos/TuneLab/go-truss/contributors","subscribers_url":"https://api.github.com/repos/TuneLab/go-truss/subscribers","subscription_url":"https://api.github.com/repos/TuneLab/go-truss/subscription","commits_url":"https://api.github.com/repos/TuneLab/go-truss/commits{/sha}","git_commits_url":"https://api.github.com/repos/TuneLab/go-truss/git/commits{/sha}","comments_url":"https://api.github.com/repos/TuneLab/go-truss/comments{/number}","issue_comment_url":"https://api.github.com/repos/TuneLab/go-truss/issues/comments{/number}","contents_url":"https://api.github.com/repos/TuneLab/go-truss/contents/{+path}","compare_url":"https://api.github.com/repos/TuneLab/go-truss/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TuneLab/go-truss/merges","archive_url":"https://api.github.com/repos/TuneLab/go-truss/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TuneLab/go-truss/downloads","issues_url":"https://api.github.com/repos/TuneLab/go-truss/issues{/number}","pulls_url":"https://api.github.com/repos/TuneLab/go-truss/pulls{/number}","milestones_url":"https://api.github.com/repos/TuneLab/go-truss/milestones{/number}","notifications_url":"https://api.github.com/repos/TuneLab/go-truss/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TuneLab/go-truss/labels{/name}","releases_url":"https://api.github.com/repos/TuneLab/go-truss/releases{/id}","deployments_url":"https://api.github.com/repos/TuneLab/go-truss/deployments","created_at":"2016-06-13T18:18:25Z","updated_at":"2017-05-21T13:01:01Z","pushed_at":"2017-06-13T22:26:44Z","git_url":"git://github.com/TuneLab/go-truss.git","ssh_url":"git@github.com:TuneLab/go-truss.git","clone_url":"https://github.com/TuneLab/go-truss.git","svn_url":"https://github.com/TuneLab/go-truss","homepage":"","size":10927,"stargazers_count":55,"watchers_count":55,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":8,"forks":10,"open_issues":8,"watchers":55,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/TuneLab/go-truss/pulls/190"},"html":{"href":"https://github.com/TuneLab/go-truss/pull/190"},"issue":{"href":"https://api.github.com/repos/TuneLab/go-truss/issues/190"},"comments":{"href":"https://api.github.com/repos/TuneLab/go-truss/issues/190/comments"},"review_comments":{"href":"https://api.github.com/repos/TuneLab/go-truss/pulls/190/comments"},"review_comment":{"href":"https://api.github.com/repos/TuneLab/go-truss/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/TuneLab/go-truss/pulls/190/commits"},"statuses":{"href":"https://api.github.com/repos/TuneLab/go-truss/statuses/00c41b6abf5040208f92bdecdba4db44d4815864"}}}}
{"actor":{"display_login":"hasIan"}}