{"action":"created","comment":{"url":"https://api.github.com/repos/line/armeria/pulls/comments/128425830","pull_request_review_id":51102255,"id":128425830,"diff_hunk":"@@ -0,0 +1,53 @@\n+/*\n+ * Copyright 2016 LINE Corporation\n+ *\n+ * LINE Corporation licenses this file to you under the Apache License,\n+ * version 2.0 (the \"License\"); you may not use this file except in compliance\n+ * with the License. You may obtain a copy of the License at:\n+ *\n+ *   http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n+ * License for the specific language governing permissions and limitations\n+ * under the License.\n+ */\n+package com.linecorp.armeria.server;\n+\n+import com.linecorp.armeria.common.HttpStatus;\n+\n+import io.netty.handler.codec.http2.Http2Error;\n+\n+/**\n+ * A {@link RuntimeException} that is raised when an armeria internal http exception has occurred.\n+ * This class is the general class of exceptions produced by a failed request or a reset stream.\n+ */\n+public abstract class ArmeriaHttpException extends RuntimeException {\n+    private static final long serialVersionUID = 3487991462085151316L;\n+\n+    private final HttpStatus httpStatus;\n+    private final Http2Error http2error;\n+\n+    /**\n+     * Creates a new instance.\n+     */\n+    protected ArmeriaHttpException(HttpStatus httpStatus, Http2Error http2error) {","path":"core/src/main/java/com/linecorp/armeria/server/ArmeriaHttpException.java","position":null,"original_position":35,"commit_id":"fc45aa3aea85973b86ef5f9bd9f5f5393360db69","original_commit_id":"88bcfc2c1eefd6fd6819b0f83181b2de298f425a","user":{"login":"trustin","id":173918,"avatar_url":"https://avatars0.githubusercontent.com/u/173918?v=4","gravatar_id":"","url":"https://api.github.com/users/trustin","html_url":"https://github.com/trustin","followers_url":"https://api.github.com/users/trustin/followers","following_url":"https://api.github.com/users/trustin/following{/other_user}","gists_url":"https://api.github.com/users/trustin/gists{/gist_id}","starred_url":"https://api.github.com/users/trustin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trustin/subscriptions","organizations_url":"https://api.github.com/users/trustin/orgs","repos_url":"https://api.github.com/users/trustin/repos","events_url":"https://api.github.com/users/trustin/events{/privacy}","received_events_url":"https://api.github.com/users/trustin/received_events","type":"User","site_admin":false},"body":"Looking from the specification (http://httpwg.org/specs/rfc7540.html#ErrorCodes) I'm pretty sure HTTP/2 Error Codes are not for applications but for session-layer implementations, so I think it's better hiding it from users.","created_at":"2017-07-20T05:04:51Z","updated_at":"2017-07-20T05:04:52Z","html_url":"https://github.com/line/armeria/pull/691#discussion_r128425830","pull_request_url":"https://api.github.com/repos/line/armeria/pulls/691","_links":{"self":{"href":"https://api.github.com/repos/line/armeria/pulls/comments/128425830"},"html":{"href":"https://github.com/line/armeria/pull/691#discussion_r128425830"},"pull_request":{"href":"https://api.github.com/repos/line/armeria/pulls/691"}}},"pull_request":{"url":"https://api.github.com/repos/line/armeria/pulls/691","id":131229274,"html_url":"https://github.com/line/armeria/pull/691","diff_url":"https://github.com/line/armeria/pull/691.diff","patch_url":"https://github.com/line/armeria/pull/691.patch","issue_url":"https://api.github.com/repos/line/armeria/issues/691","number":691,"state":"open","locked":false,"title":"Customize http status and http2error for error response","user":{"login":"imasahiro","id":73532,"avatar_url":"https://avatars1.githubusercontent.com/u/73532?v=4","gravatar_id":"","url":"https://api.github.com/users/imasahiro","html_url":"https://github.com/imasahiro","followers_url":"https://api.github.com/users/imasahiro/followers","following_url":"https://api.github.com/users/imasahiro/following{/other_user}","gists_url":"https://api.github.com/users/imasahiro/gists{/gist_id}","starred_url":"https://api.github.com/users/imasahiro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imasahiro/subscriptions","organizations_url":"https://api.github.com/users/imasahiro/orgs","repos_url":"https://api.github.com/users/imasahiro/repos","events_url":"https://api.github.com/users/imasahiro/events{/privacy}","received_events_url":"https://api.github.com/users/imasahiro/received_events","type":"User","site_admin":false},"body":"Motivations:\r\n- The error behavior of HttpResponseSubscriber#onError is hard-coded and cannot customize error code.\r\n\r\nModifications:\r\n- Add ArmeriaHttpException which makes more customizable error handling\r\n\r\nResults:\r\n- A user can customize error code through ArmeriaHttpException\r\n- Fixes #543","created_at":"2017-07-19T03:16:56Z","updated_at":"2017-07-20T05:04:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"69722d62d19b89e30da327c843bd65a38c5ad701","assignee":null,"assignees":[],"requested_reviewers":[{"login":"anuraaga","id":198344,"avatar_url":"https://avatars0.githubusercontent.com/u/198344?v=4","gravatar_id":"","url":"https://api.github.com/users/anuraaga","html_url":"https://github.com/anuraaga","followers_url":"https://api.github.com/users/anuraaga/followers","following_url":"https://api.github.com/users/anuraaga/following{/other_user}","gists_url":"https://api.github.com/users/anuraaga/gists{/gist_id}","starred_url":"https://api.github.com/users/anuraaga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anuraaga/subscriptions","organizations_url":"https://api.github.com/users/anuraaga/orgs","repos_url":"https://api.github.com/users/anuraaga/repos","events_url":"https://api.github.com/users/anuraaga/events{/privacy}","received_events_url":"https://api.github.com/users/anuraaga/received_events","type":"User","site_admin":false},{"login":"hyangtack","id":8417787,"avatar_url":"https://avatars1.githubusercontent.com/u/8417787?v=4","gravatar_id":"","url":"https://api.github.com/users/hyangtack","html_url":"https://github.com/hyangtack","followers_url":"https://api.github.com/users/hyangtack/followers","following_url":"https://api.github.com/users/hyangtack/following{/other_user}","gists_url":"https://api.github.com/users/hyangtack/gists{/gist_id}","starred_url":"https://api.github.com/users/hyangtack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyangtack/subscriptions","organizations_url":"https://api.github.com/users/hyangtack/orgs","repos_url":"https://api.github.com/users/hyangtack/repos","events_url":"https://api.github.com/users/hyangtack/events{/privacy}","received_events_url":"https://api.github.com/users/hyangtack/received_events","type":"User","site_admin":false},{"login":"minwoox","id":25103250,"avatar_url":"https://avatars2.githubusercontent.com/u/25103250?v=4","gravatar_id":"","url":"https://api.github.com/users/minwoox","html_url":"https://github.com/minwoox","followers_url":"https://api.github.com/users/minwoox/followers","following_url":"https://api.github.com/users/minwoox/following{/other_user}","gists_url":"https://api.github.com/users/minwoox/gists{/gist_id}","starred_url":"https://api.github.com/users/minwoox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minwoox/subscriptions","organizations_url":"https://api.github.com/users/minwoox/orgs","repos_url":"https://api.github.com/users/minwoox/repos","events_url":"https://api.github.com/users/minwoox/events{/privacy}","received_events_url":"https://api.github.com/users/minwoox/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/line/armeria/pulls/691/commits","review_comments_url":"https://api.github.com/repos/line/armeria/pulls/691/comments","review_comment_url":"https://api.github.com/repos/line/armeria/pulls/comments{/number}","comments_url":"https://api.github.com/repos/line/armeria/issues/691/comments","statuses_url":"https://api.github.com/repos/line/armeria/statuses/fc45aa3aea85973b86ef5f9bd9f5f5393360db69","head":{"label":"imasahiro:issue543","ref":"issue543","sha":"fc45aa3aea85973b86ef5f9bd9f5f5393360db69","user":{"login":"imasahiro","id":73532,"avatar_url":"https://avatars1.githubusercontent.com/u/73532?v=4","gravatar_id":"","url":"https://api.github.com/users/imasahiro","html_url":"https://github.com/imasahiro","followers_url":"https://api.github.com/users/imasahiro/followers","following_url":"https://api.github.com/users/imasahiro/following{/other_user}","gists_url":"https://api.github.com/users/imasahiro/gists{/gist_id}","starred_url":"https://api.github.com/users/imasahiro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imasahiro/subscriptions","organizations_url":"https://api.github.com/users/imasahiro/orgs","repos_url":"https://api.github.com/users/imasahiro/repos","events_url":"https://api.github.com/users/imasahiro/events{/privacy}","received_events_url":"https://api.github.com/users/imasahiro/received_events","type":"User","site_admin":false},"repo":{"id":60108021,"name":"armeria","full_name":"imasahiro/armeria","owner":{"login":"imasahiro","id":73532,"avatar_url":"https://avatars1.githubusercontent.com/u/73532?v=4","gravatar_id":"","url":"https://api.github.com/users/imasahiro","html_url":"https://github.com/imasahiro","followers_url":"https://api.github.com/users/imasahiro/followers","following_url":"https://api.github.com/users/imasahiro/following{/other_user}","gists_url":"https://api.github.com/users/imasahiro/gists{/gist_id}","starred_url":"https://api.github.com/users/imasahiro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imasahiro/subscriptions","organizations_url":"https://api.github.com/users/imasahiro/orgs","repos_url":"https://api.github.com/users/imasahiro/repos","events_url":"https://api.github.com/users/imasahiro/events{/privacy}","received_events_url":"https://api.github.com/users/imasahiro/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/imasahiro/armeria","description":"Asynchronous RPC/API client/server library built on top of Java 8, Netty 4.1, HTTP/2, and Thrift","fork":true,"url":"https://api.github.com/repos/imasahiro/armeria","forks_url":"https://api.github.com/repos/imasahiro/armeria/forks","keys_url":"https://api.github.com/repos/imasahiro/armeria/keys{/key_id}","collaborators_url":"https://api.github.com/repos/imasahiro/armeria/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/imasahiro/armeria/teams","hooks_url":"https://api.github.com/repos/imasahiro/armeria/hooks","issue_events_url":"https://api.github.com/repos/imasahiro/armeria/issues/events{/number}","events_url":"https://api.github.com/repos/imasahiro/armeria/events","assignees_url":"https://api.github.com/repos/imasahiro/armeria/assignees{/user}","branches_url":"https://api.github.com/repos/imasahiro/armeria/branches{/branch}","tags_url":"https://api.github.com/repos/imasahiro/armeria/tags","blobs_url":"https://api.github.com/repos/imasahiro/armeria/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/imasahiro/armeria/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/imasahiro/armeria/git/refs{/sha}","trees_url":"https://api.github.com/repos/imasahiro/armeria/git/trees{/sha}","statuses_url":"https://api.github.com/repos/imasahiro/armeria/statuses/{sha}","languages_url":"https://api.github.com/repos/imasahiro/armeria/languages","stargazers_url":"https://api.github.com/repos/imasahiro/armeria/stargazers","contributors_url":"https://api.github.com/repos/imasahiro/armeria/contributors","subscribers_url":"https://api.github.com/repos/imasahiro/armeria/subscribers","subscription_url":"https://api.github.com/repos/imasahiro/armeria/subscription","commits_url":"https://api.github.com/repos/imasahiro/armeria/commits{/sha}","git_commits_url":"https://api.github.com/repos/imasahiro/armeria/git/commits{/sha}","comments_url":"https://api.github.com/repos/imasahiro/armeria/comments{/number}","issue_comment_url":"https://api.github.com/repos/imasahiro/armeria/issues/comments{/number}","contents_url":"https://api.github.com/repos/imasahiro/armeria/contents/{+path}","compare_url":"https://api.github.com/repos/imasahiro/armeria/compare/{base}...{head}","merges_url":"https://api.github.com/repos/imasahiro/armeria/merges","archive_url":"https://api.github.com/repos/imasahiro/armeria/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/imasahiro/armeria/downloads","issues_url":"https://api.github.com/repos/imasahiro/armeria/issues{/number}","pulls_url":"https://api.github.com/repos/imasahiro/armeria/pulls{/number}","milestones_url":"https://api.github.com/repos/imasahiro/armeria/milestones{/number}","notifications_url":"https://api.github.com/repos/imasahiro/armeria/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/imasahiro/armeria/labels{/name}","releases_url":"https://api.github.com/repos/imasahiro/armeria/releases{/id}","deployments_url":"https://api.github.com/repos/imasahiro/armeria/deployments","created_at":"2016-05-31T17:03:15Z","updated_at":"2016-05-31T17:03:18Z","pushed_at":"2017-07-19T08:39:36Z","git_url":"git://github.com/imasahiro/armeria.git","ssh_url":"git@github.com:imasahiro/armeria.git","clone_url":"https://github.com/imasahiro/armeria.git","svn_url":"https://github.com/imasahiro/armeria","homepage":"http://line.github.io/armeria/","size":23013,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"line:master","ref":"master","sha":"b37e7ded24a9f151a4f8024decfa14d7a96c32e3","user":{"login":"line","id":13128444,"avatar_url":"https://avatars2.githubusercontent.com/u/13128444?v=4","gravatar_id":"","url":"https://api.github.com/users/line","html_url":"https://github.com/line","followers_url":"https://api.github.com/users/line/followers","following_url":"https://api.github.com/users/line/following{/other_user}","gists_url":"https://api.github.com/users/line/gists{/gist_id}","starred_url":"https://api.github.com/users/line/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/line/subscriptions","organizations_url":"https://api.github.com/users/line/orgs","repos_url":"https://api.github.com/users/line/repos","events_url":"https://api.github.com/users/line/events{/privacy}","received_events_url":"https://api.github.com/users/line/received_events","type":"Organization","site_admin":false},"repo":{"id":46251204,"name":"armeria","full_name":"line/armeria","owner":{"login":"line","id":13128444,"avatar_url":"https://avatars2.githubusercontent.com/u/13128444?v=4","gravatar_id":"","url":"https://api.github.com/users/line","html_url":"https://github.com/line","followers_url":"https://api.github.com/users/line/followers","following_url":"https://api.github.com/users/line/following{/other_user}","gists_url":"https://api.github.com/users/line/gists{/gist_id}","starred_url":"https://api.github.com/users/line/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/line/subscriptions","organizations_url":"https://api.github.com/users/line/orgs","repos_url":"https://api.github.com/users/line/repos","events_url":"https://api.github.com/users/line/events{/privacy}","received_events_url":"https://api.github.com/users/line/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/line/armeria","description":"Asynchronous RPC/API client/server library built on top of Java 8, Netty, HTTP/2, Thrift and gRPC","fork":false,"url":"https://api.github.com/repos/line/armeria","forks_url":"https://api.github.com/repos/line/armeria/forks","keys_url":"https://api.github.com/repos/line/armeria/keys{/key_id}","collaborators_url":"https://api.github.com/repos/line/armeria/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/line/armeria/teams","hooks_url":"https://api.github.com/repos/line/armeria/hooks","issue_events_url":"https://api.github.com/repos/line/armeria/issues/events{/number}","events_url":"https://api.github.com/repos/line/armeria/events","assignees_url":"https://api.github.com/repos/line/armeria/assignees{/user}","branches_url":"https://api.github.com/repos/line/armeria/branches{/branch}","tags_url":"https://api.github.com/repos/line/armeria/tags","blobs_url":"https://api.github.com/repos/line/armeria/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/line/armeria/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/line/armeria/git/refs{/sha}","trees_url":"https://api.github.com/repos/line/armeria/git/trees{/sha}","statuses_url":"https://api.github.com/repos/line/armeria/statuses/{sha}","languages_url":"https://api.github.com/repos/line/armeria/languages","stargazers_url":"https://api.github.com/repos/line/armeria/stargazers","contributors_url":"https://api.github.com/repos/line/armeria/contributors","subscribers_url":"https://api.github.com/repos/line/armeria/subscribers","subscription_url":"https://api.github.com/repos/line/armeria/subscription","commits_url":"https://api.github.com/repos/line/armeria/commits{/sha}","git_commits_url":"https://api.github.com/repos/line/armeria/git/commits{/sha}","comments_url":"https://api.github.com/repos/line/armeria/comments{/number}","issue_comment_url":"https://api.github.com/repos/line/armeria/issues/comments{/number}","contents_url":"https://api.github.com/repos/line/armeria/contents/{+path}","compare_url":"https://api.github.com/repos/line/armeria/compare/{base}...{head}","merges_url":"https://api.github.com/repos/line/armeria/merges","archive_url":"https://api.github.com/repos/line/armeria/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/line/armeria/downloads","issues_url":"https://api.github.com/repos/line/armeria/issues{/number}","pulls_url":"https://api.github.com/repos/line/armeria/pulls{/number}","milestones_url":"https://api.github.com/repos/line/armeria/milestones{/number}","notifications_url":"https://api.github.com/repos/line/armeria/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/line/armeria/labels{/name}","releases_url":"https://api.github.com/repos/line/armeria/releases{/id}","deployments_url":"https://api.github.com/repos/line/armeria/deployments","created_at":"2015-11-16T04:04:01Z","updated_at":"2017-07-19T06:07:56Z","pushed_at":"2017-07-19T09:19:06Z","git_url":"git://github.com/line/armeria.git","ssh_url":"git@github.com:line/armeria.git","clone_url":"https://github.com/line/armeria.git","svn_url":"https://github.com/line/armeria","homepage":"http://line.github.io/armeria/","size":24716,"stargazers_count":827,"watchers_count":827,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":213,"mirror_url":null,"open_issues_count":60,"forks":213,"open_issues":60,"watchers":827,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/line/armeria/pulls/691"},"html":{"href":"https://github.com/line/armeria/pull/691"},"issue":{"href":"https://api.github.com/repos/line/armeria/issues/691"},"comments":{"href":"https://api.github.com/repos/line/armeria/issues/691/comments"},"review_comments":{"href":"https://api.github.com/repos/line/armeria/pulls/691/comments"},"review_comment":{"href":"https://api.github.com/repos/line/armeria/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/line/armeria/pulls/691/commits"},"statuses":{"href":"https://api.github.com/repos/line/armeria/statuses/fc45aa3aea85973b86ef5f9bd9f5f5393360db69"}}}}
{"actor":{"display_login":"trustin"}}