{"action":"created","comment":{"url":"https://api.github.com/repos/palantir/http-remoting/pulls/comments/53396161","id":53396161,"diff_hunk":"@@ -101,18 +106,16 @@ public Exception decode(String methodKey, Response response) {\n         }\n     }\n \n-    private static Exception constructException(Class<? extends Exception> exceptionClass, String message) {\n-        try {\n-            return exceptionClass.getConstructor(String.class).newInstance(message);\n-        } catch (Exception e1) {\n-            return new RuntimeException(String.format(\n-                    \"Failed to construction exception of type %s, constructing RuntimeException instead: %s%n%s\",\n-                    exceptionClass.toString(), e1.toString(), message));\n+    private static Exception constructException(","path":"http-clients/src/main/java/com/palantir/remoting/http/errors/SerializableErrorErrorDecoder.java","position":41,"original_position":41,"commit_id":"af267f483b267d290ab7942eb26cf3eb8bc75e6c","original_commit_id":"af267f483b267d290ab7942eb26cf3eb8bc75e6c","user":{"login":"akroy","id":4286394,"avatar_url":"https://avatars.githubusercontent.com/u/4286394?v=3","gravatar_id":"","url":"https://api.github.com/users/akroy","html_url":"https://github.com/akroy","followers_url":"https://api.github.com/users/akroy/followers","following_url":"https://api.github.com/users/akroy/following{/other_user}","gists_url":"https://api.github.com/users/akroy/gists{/gist_id}","starred_url":"https://api.github.com/users/akroy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akroy/subscriptions","organizations_url":"https://api.github.com/users/akroy/orgs","repos_url":"https://api.github.com/users/akroy/repos","events_url":"https://api.github.com/users/akroy/events{/privacy}","received_events_url":"https://api.github.com/users/akroy/received_events","type":"User","site_admin":false},"body":"Hey Jason! HTTP-remoting's handling of exceptions was actually doubly broken:\r\n- most exceptions were thrown as 500s on server side (what you're mentioning)\r\n- most exceptions were failing to decode on client side (what this commit is)\r\n\r\nBoth of these errors were related to the same failure to deal with WebApplication, ClientError, or ServerError exceptions, just in different places. I already fixed the problem you mention at https://github.com/palantir/http-remoting/pull/48 .","created_at":"2016-02-18T22:50:32Z","updated_at":"2016-02-18T22:50:32Z","html_url":"https://github.com/palantir/http-remoting/pull/45#discussion_r53396161","pull_request_url":"https://api.github.com/repos/palantir/http-remoting/pulls/45","_links":{"self":{"href":"https://api.github.com/repos/palantir/http-remoting/pulls/comments/53396161"},"html":{"href":"https://github.com/palantir/http-remoting/pull/45#discussion_r53396161"},"pull_request":{"href":"https://api.github.com/repos/palantir/http-remoting/pulls/45"}}},"pull_request":{"url":"https://api.github.com/repos/palantir/http-remoting/pulls/45","id":59391305,"html_url":"https://github.com/palantir/http-remoting/pull/45","diff_url":"https://github.com/palantir/http-remoting/pull/45.diff","patch_url":"https://github.com/palantir/http-remoting/pull/45.patch","issue_url":"https://api.github.com/repos/palantir/http-remoting/issues/45","number":45,"state":"open","locked":false,"title":"Decode general web exceptions","user":{"login":"akroy","id":4286394,"avatar_url":"https://avatars.githubusercontent.com/u/4286394?v=3","gravatar_id":"","url":"https://api.github.com/users/akroy","html_url":"https://github.com/akroy","followers_url":"https://api.github.com/users/akroy/followers","following_url":"https://api.github.com/users/akroy/following{/other_user}","gists_url":"https://api.github.com/users/akroy/gists{/gist_id}","starred_url":"https://api.github.com/users/akroy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akroy/subscriptions","organizations_url":"https://api.github.com/users/akroy/orgs","repos_url":"https://api.github.com/users/akroy/repos","events_url":"https://api.github.com/users/akroy/events{/privacy}","received_events_url":"https://api.github.com/users/akroy/received_events","type":"User","site_admin":false},"body":"Previously, exceptions corresponding to specific HTTP error codes (e.g. BadRequestException) would be properly decoded, but more general exceptions that just hold a status value (e.g. ClientErrorException) would fail to decode.\r\n\r\nWe now handle:\r\n- WebApplicationException\r\n- ServerErrorException\r\n- ClientErrorException\r\n\r\nFixes #24 ","created_at":"2016-02-15T17:11:38Z","updated_at":"2016-02-18T22:50:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0e59c92c97d66e0742c0260b4492174c529df114","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/palantir/http-remoting/pulls/45/commits","review_comments_url":"https://api.github.com/repos/palantir/http-remoting/pulls/45/comments","review_comment_url":"https://api.github.com/repos/palantir/http-remoting/pulls/comments{/number}","comments_url":"https://api.github.com/repos/palantir/http-remoting/issues/45/comments","statuses_url":"https://api.github.com/repos/palantir/http-remoting/statuses/af267f483b267d290ab7942eb26cf3eb8bc75e6c","head":{"label":"akroy:feature/handle-general-web-exceptions","ref":"feature/handle-general-web-exceptions","sha":"af267f483b267d290ab7942eb26cf3eb8bc75e6c","user":{"login":"akroy","id":4286394,"avatar_url":"https://avatars.githubusercontent.com/u/4286394?v=3","gravatar_id":"","url":"https://api.github.com/users/akroy","html_url":"https://github.com/akroy","followers_url":"https://api.github.com/users/akroy/followers","following_url":"https://api.github.com/users/akroy/following{/other_user}","gists_url":"https://api.github.com/users/akroy/gists{/gist_id}","starred_url":"https://api.github.com/users/akroy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akroy/subscriptions","organizations_url":"https://api.github.com/users/akroy/orgs","repos_url":"https://api.github.com/users/akroy/repos","events_url":"https://api.github.com/users/akroy/events{/privacy}","received_events_url":"https://api.github.com/users/akroy/received_events","type":"User","site_admin":false},"repo":{"id":51771434,"name":"http-remoting","full_name":"akroy/http-remoting","owner":{"login":"akroy","id":4286394,"avatar_url":"https://avatars.githubusercontent.com/u/4286394?v=3","gravatar_id":"","url":"https://api.github.com/users/akroy","html_url":"https://github.com/akroy","followers_url":"https://api.github.com/users/akroy/followers","following_url":"https://api.github.com/users/akroy/following{/other_user}","gists_url":"https://api.github.com/users/akroy/gists{/gist_id}","starred_url":"https://api.github.com/users/akroy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akroy/subscriptions","organizations_url":"https://api.github.com/users/akroy/orgs","repos_url":"https://api.github.com/users/akroy/repos","events_url":"https://api.github.com/users/akroy/events{/privacy}","received_events_url":"https://api.github.com/users/akroy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/akroy/http-remoting","description":"a collection of useful utilities for use with HTTP remoting setups that use Feign as a client and Jersey as a server","fork":true,"url":"https://api.github.com/repos/akroy/http-remoting","forks_url":"https://api.github.com/repos/akroy/http-remoting/forks","keys_url":"https://api.github.com/repos/akroy/http-remoting/keys{/key_id}","collaborators_url":"https://api.github.com/repos/akroy/http-remoting/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/akroy/http-remoting/teams","hooks_url":"https://api.github.com/repos/akroy/http-remoting/hooks","issue_events_url":"https://api.github.com/repos/akroy/http-remoting/issues/events{/number}","events_url":"https://api.github.com/repos/akroy/http-remoting/events","assignees_url":"https://api.github.com/repos/akroy/http-remoting/assignees{/user}","branches_url":"https://api.github.com/repos/akroy/http-remoting/branches{/branch}","tags_url":"https://api.github.com/repos/akroy/http-remoting/tags","blobs_url":"https://api.github.com/repos/akroy/http-remoting/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/akroy/http-remoting/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/akroy/http-remoting/git/refs{/sha}","trees_url":"https://api.github.com/repos/akroy/http-remoting/git/trees{/sha}","statuses_url":"https://api.github.com/repos/akroy/http-remoting/statuses/{sha}","languages_url":"https://api.github.com/repos/akroy/http-remoting/languages","stargazers_url":"https://api.github.com/repos/akroy/http-remoting/stargazers","contributors_url":"https://api.github.com/repos/akroy/http-remoting/contributors","subscribers_url":"https://api.github.com/repos/akroy/http-remoting/subscribers","subscription_url":"https://api.github.com/repos/akroy/http-remoting/subscription","commits_url":"https://api.github.com/repos/akroy/http-remoting/commits{/sha}","git_commits_url":"https://api.github.com/repos/akroy/http-remoting/git/commits{/sha}","comments_url":"https://api.github.com/repos/akroy/http-remoting/comments{/number}","issue_comment_url":"https://api.github.com/repos/akroy/http-remoting/issues/comments{/number}","contents_url":"https://api.github.com/repos/akroy/http-remoting/contents/{+path}","compare_url":"https://api.github.com/repos/akroy/http-remoting/compare/{base}...{head}","merges_url":"https://api.github.com/repos/akroy/http-remoting/merges","archive_url":"https://api.github.com/repos/akroy/http-remoting/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/akroy/http-remoting/downloads","issues_url":"https://api.github.com/repos/akroy/http-remoting/issues{/number}","pulls_url":"https://api.github.com/repos/akroy/http-remoting/pulls{/number}","milestones_url":"https://api.github.com/repos/akroy/http-remoting/milestones{/number}","notifications_url":"https://api.github.com/repos/akroy/http-remoting/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/akroy/http-remoting/labels{/name}","releases_url":"https://api.github.com/repos/akroy/http-remoting/releases{/id}","deployments_url":"https://api.github.com/repos/akroy/http-remoting/deployments","created_at":"2016-02-15T17:10:10Z","updated_at":"2016-02-15T17:10:11Z","pushed_at":"2016-02-18T18:16:41Z","git_url":"git://github.com/akroy/http-remoting.git","ssh_url":"git@github.com:akroy/http-remoting.git","clone_url":"https://github.com/akroy/http-remoting.git","svn_url":"https://github.com/akroy/http-remoting","homepage":"","size":209,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"develop"}},"base":{"label":"palantir:develop","ref":"develop","sha":"eaa6423dffbc7a7cc979829fbb4d3cd84f274b6d","user":{"login":"palantir","id":303157,"avatar_url":"https://avatars.githubusercontent.com/u/303157?v=3","gravatar_id":"","url":"https://api.github.com/users/palantir","html_url":"https://github.com/palantir","followers_url":"https://api.github.com/users/palantir/followers","following_url":"https://api.github.com/users/palantir/following{/other_user}","gists_url":"https://api.github.com/users/palantir/gists{/gist_id}","starred_url":"https://api.github.com/users/palantir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/palantir/subscriptions","organizations_url":"https://api.github.com/users/palantir/orgs","repos_url":"https://api.github.com/users/palantir/repos","events_url":"https://api.github.com/users/palantir/events{/privacy}","received_events_url":"https://api.github.com/users/palantir/received_events","type":"Organization","site_admin":false},"repo":{"id":43088077,"name":"http-remoting","full_name":"palantir/http-remoting","owner":{"login":"palantir","id":303157,"avatar_url":"https://avatars.githubusercontent.com/u/303157?v=3","gravatar_id":"","url":"https://api.github.com/users/palantir","html_url":"https://github.com/palantir","followers_url":"https://api.github.com/users/palantir/followers","following_url":"https://api.github.com/users/palantir/following{/other_user}","gists_url":"https://api.github.com/users/palantir/gists{/gist_id}","starred_url":"https://api.github.com/users/palantir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/palantir/subscriptions","organizations_url":"https://api.github.com/users/palantir/orgs","repos_url":"https://api.github.com/users/palantir/repos","events_url":"https://api.github.com/users/palantir/events{/privacy}","received_events_url":"https://api.github.com/users/palantir/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/palantir/http-remoting","description":"a collection of useful utilities for use with HTTP remoting setups that use Feign as a client and Jersey as a server","fork":false,"url":"https://api.github.com/repos/palantir/http-remoting","forks_url":"https://api.github.com/repos/palantir/http-remoting/forks","keys_url":"https://api.github.com/repos/palantir/http-remoting/keys{/key_id}","collaborators_url":"https://api.github.com/repos/palantir/http-remoting/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/palantir/http-remoting/teams","hooks_url":"https://api.github.com/repos/palantir/http-remoting/hooks","issue_events_url":"https://api.github.com/repos/palantir/http-remoting/issues/events{/number}","events_url":"https://api.github.com/repos/palantir/http-remoting/events","assignees_url":"https://api.github.com/repos/palantir/http-remoting/assignees{/user}","branches_url":"https://api.github.com/repos/palantir/http-remoting/branches{/branch}","tags_url":"https://api.github.com/repos/palantir/http-remoting/tags","blobs_url":"https://api.github.com/repos/palantir/http-remoting/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/palantir/http-remoting/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/palantir/http-remoting/git/refs{/sha}","trees_url":"https://api.github.com/repos/palantir/http-remoting/git/trees{/sha}","statuses_url":"https://api.github.com/repos/palantir/http-remoting/statuses/{sha}","languages_url":"https://api.github.com/repos/palantir/http-remoting/languages","stargazers_url":"https://api.github.com/repos/palantir/http-remoting/stargazers","contributors_url":"https://api.github.com/repos/palantir/http-remoting/contributors","subscribers_url":"https://api.github.com/repos/palantir/http-remoting/subscribers","subscription_url":"https://api.github.com/repos/palantir/http-remoting/subscription","commits_url":"https://api.github.com/repos/palantir/http-remoting/commits{/sha}","git_commits_url":"https://api.github.com/repos/palantir/http-remoting/git/commits{/sha}","comments_url":"https://api.github.com/repos/palantir/http-remoting/comments{/number}","issue_comment_url":"https://api.github.com/repos/palantir/http-remoting/issues/comments{/number}","contents_url":"https://api.github.com/repos/palantir/http-remoting/contents/{+path}","compare_url":"https://api.github.com/repos/palantir/http-remoting/compare/{base}...{head}","merges_url":"https://api.github.com/repos/palantir/http-remoting/merges","archive_url":"https://api.github.com/repos/palantir/http-remoting/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/palantir/http-remoting/downloads","issues_url":"https://api.github.com/repos/palantir/http-remoting/issues{/number}","pulls_url":"https://api.github.com/repos/palantir/http-remoting/pulls{/number}","milestones_url":"https://api.github.com/repos/palantir/http-remoting/milestones{/number}","notifications_url":"https://api.github.com/repos/palantir/http-remoting/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/palantir/http-remoting/labels{/name}","releases_url":"https://api.github.com/repos/palantir/http-remoting/releases{/id}","deployments_url":"https://api.github.com/repos/palantir/http-remoting/deployments","created_at":"2015-09-24T19:24:22Z","updated_at":"2016-02-07T22:25:28Z","pushed_at":"2016-02-18T22:46:49Z","git_url":"git://github.com/palantir/http-remoting.git","ssh_url":"git@github.com:palantir/http-remoting.git","clone_url":"https://github.com/palantir/http-remoting.git","svn_url":"https://github.com/palantir/http-remoting","homepage":"","size":236,"stargazers_count":3,"watchers_count":3,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":9,"forks":11,"open_issues":9,"watchers":3,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/palantir/http-remoting/pulls/45"},"html":{"href":"https://github.com/palantir/http-remoting/pull/45"},"issue":{"href":"https://api.github.com/repos/palantir/http-remoting/issues/45"},"comments":{"href":"https://api.github.com/repos/palantir/http-remoting/issues/45/comments"},"review_comments":{"href":"https://api.github.com/repos/palantir/http-remoting/pulls/45/comments"},"review_comment":{"href":"https://api.github.com/repos/palantir/http-remoting/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/palantir/http-remoting/pulls/45/commits"},"statuses":{"href":"https://api.github.com/repos/palantir/http-remoting/statuses/af267f483b267d290ab7942eb26cf3eb8bc75e6c"}}}}