{"action":"created","comment":{"url":"https://api.github.com/repos/Wikia/pandora/pulls/comments/45464356","id":45464356,"diff_hunk":"@@ -0,0 +1,29 @@\n+package com.wikia.services.userregistration.bundles;\n+\n+import com.wikia.gateway.GatewayExceptionMapper;\n+import com.wikia.services.userregistration.exceptions.UserCreationExceptionMapper;\n+import com.wikia.services.userregistration.exceptions.UserExistsExceptionMapper;\n+import com.wikia.services.userregistration.validation.ValidationExceptionMapper;\n+\n+import com.theoryinpractise.halbuilder.jaxrs.JaxRsHalBuilderSupport;\n+import io.dropwizard.Configuration;\n+import io.dropwizard.ConfiguredBundle;\n+import io.dropwizard.setup.Bootstrap;\n+import io.dropwizard.setup.Environment;\n+\n+\n+public class UserRegistrationExceptionMapperBundle<T extends Configuration> implements ConfiguredBundle<T> {\n+    @Override\n+    public void initialize(Bootstrap<?> bootstrap) {\n+      // nothing to initialize in this bundle\n+    }\n+\n+    @Override\n+    public void run(T configuration, Environment environment) {\n+      environment.jersey().register(JaxRsHalBuilderSupport.class);","path":"service/user-registration/src/main/java/com/wikia/services/userregistration/bundles/UserRegistrationExceptionMapperBundle.java","position":23,"original_position":23,"commit_id":"2410ddad5bc245fddf2aaaed6003e3b07db0ca90","original_commit_id":"2410ddad5bc245fddf2aaaed6003e3b07db0ca90","user":{"login":"sqreek","id":6649776,"avatar_url":"https://avatars.githubusercontent.com/u/6649776?v=3","gravatar_id":"","url":"https://api.github.com/users/sqreek","html_url":"https://github.com/sqreek","followers_url":"https://api.github.com/users/sqreek/followers","following_url":"https://api.github.com/users/sqreek/following{/other_user}","gists_url":"https://api.github.com/users/sqreek/gists{/gist_id}","starred_url":"https://api.github.com/users/sqreek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sqreek/subscriptions","organizations_url":"https://api.github.com/users/sqreek/orgs","repos_url":"https://api.github.com/users/sqreek/repos","events_url":"https://api.github.com/users/sqreek/events{/privacy}","received_events_url":"https://api.github.com/users/sqreek/received_events","type":"User","site_admin":false},"body":"a) this should not be in Exception Mapper\r\nb) this should not be in our service because we are not using Hal here","created_at":"2015-11-20T12:36:42Z","updated_at":"2015-11-20T12:36:42Z","html_url":"https://github.com/Wikia/pandora/pull/649#discussion_r45464356","pull_request_url":"https://api.github.com/repos/Wikia/pandora/pulls/649","_links":{"self":{"href":"https://api.github.com/repos/Wikia/pandora/pulls/comments/45464356"},"html":{"href":"https://github.com/Wikia/pandora/pull/649#discussion_r45464356"},"pull_request":{"href":"https://api.github.com/repos/Wikia/pandora/pulls/649"}}},"pull_request":{"url":"https://api.github.com/repos/Wikia/pandora/pulls/649","id":51350871,"html_url":"https://github.com/Wikia/pandora/pull/649","diff_url":"https://github.com/Wikia/pandora/pull/649.diff","patch_url":"https://github.com/Wikia/pandora/pull/649.patch","issue_url":"https://api.github.com/repos/Wikia/pandora/issues/649","number":649,"state":"open","locked":false,"title":"SERVICES-1014: handling duplicate key","user":{"login":"harnash","id":783242,"avatar_url":"https://avatars.githubusercontent.com/u/783242?v=3","gravatar_id":"","url":"https://api.github.com/users/harnash","html_url":"https://github.com/harnash","followers_url":"https://api.github.com/users/harnash/followers","following_url":"https://api.github.com/users/harnash/following{/other_user}","gists_url":"https://api.github.com/users/harnash/gists{/gist_id}","starred_url":"https://api.github.com/users/harnash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harnash/subscriptions","organizations_url":"https://api.github.com/users/harnash/orgs","repos_url":"https://api.github.com/users/harnash/repos","events_url":"https://api.github.com/users/harnash/events{/privacy}","received_events_url":"https://api.github.com/users/harnash/received_events","type":"User","site_admin":false},"body":"Simple task not so simple solution. To properly handle key duplicates we had to add custom exception and a mapper to properly return 409 status code.\r\nAdditionally it there is some not-so-pretty try-catch code which needs to unwrap the proper exception from {{DataAccessException}} since we want to handle just one specific case.","created_at":"2015-11-20T12:29:04Z","updated_at":"2015-11-20T12:36:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"16c93fc495d2f46a312c32ea7dc46ae00c5c7529","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Wikia/pandora/pulls/649/commits","review_comments_url":"https://api.github.com/repos/Wikia/pandora/pulls/649/comments","review_comment_url":"https://api.github.com/repos/Wikia/pandora/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Wikia/pandora/issues/649/comments","statuses_url":"https://api.github.com/repos/Wikia/pandora/statuses/2410ddad5bc245fddf2aaaed6003e3b07db0ca90","head":{"label":"Wikia:SERVICES-1014-handling_duplicate_key","ref":"SERVICES-1014-handling_duplicate_key","sha":"2410ddad5bc245fddf2aaaed6003e3b07db0ca90","user":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"repo":{"id":26663749,"name":"pandora","full_name":"Wikia/pandora","owner":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Wikia/pandora","description":"API Service","fork":false,"url":"https://api.github.com/repos/Wikia/pandora","forks_url":"https://api.github.com/repos/Wikia/pandora/forks","keys_url":"https://api.github.com/repos/Wikia/pandora/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Wikia/pandora/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Wikia/pandora/teams","hooks_url":"https://api.github.com/repos/Wikia/pandora/hooks","issue_events_url":"https://api.github.com/repos/Wikia/pandora/issues/events{/number}","events_url":"https://api.github.com/repos/Wikia/pandora/events","assignees_url":"https://api.github.com/repos/Wikia/pandora/assignees{/user}","branches_url":"https://api.github.com/repos/Wikia/pandora/branches{/branch}","tags_url":"https://api.github.com/repos/Wikia/pandora/tags","blobs_url":"https://api.github.com/repos/Wikia/pandora/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Wikia/pandora/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Wikia/pandora/git/refs{/sha}","trees_url":"https://api.github.com/repos/Wikia/pandora/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Wikia/pandora/statuses/{sha}","languages_url":"https://api.github.com/repos/Wikia/pandora/languages","stargazers_url":"https://api.github.com/repos/Wikia/pandora/stargazers","contributors_url":"https://api.github.com/repos/Wikia/pandora/contributors","subscribers_url":"https://api.github.com/repos/Wikia/pandora/subscribers","subscription_url":"https://api.github.com/repos/Wikia/pandora/subscription","commits_url":"https://api.github.com/repos/Wikia/pandora/commits{/sha}","git_commits_url":"https://api.github.com/repos/Wikia/pandora/git/commits{/sha}","comments_url":"https://api.github.com/repos/Wikia/pandora/comments{/number}","issue_comment_url":"https://api.github.com/repos/Wikia/pandora/issues/comments{/number}","contents_url":"https://api.github.com/repos/Wikia/pandora/contents/{+path}","compare_url":"https://api.github.com/repos/Wikia/pandora/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Wikia/pandora/merges","archive_url":"https://api.github.com/repos/Wikia/pandora/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Wikia/pandora/downloads","issues_url":"https://api.github.com/repos/Wikia/pandora/issues{/number}","pulls_url":"https://api.github.com/repos/Wikia/pandora/pulls{/number}","milestones_url":"https://api.github.com/repos/Wikia/pandora/milestones{/number}","notifications_url":"https://api.github.com/repos/Wikia/pandora/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Wikia/pandora/labels{/name}","releases_url":"https://api.github.com/repos/Wikia/pandora/releases{/id}","created_at":"2014-11-15T00:29:06Z","updated_at":"2015-11-04T16:44:11Z","pushed_at":"2015-11-20T12:29:04Z","git_url":"git://github.com/Wikia/pandora.git","ssh_url":"git@github.com:Wikia/pandora.git","clone_url":"https://github.com/Wikia/pandora.git","svn_url":"https://github.com/Wikia/pandora","homepage":null,"size":16933,"stargazers_count":3,"watchers_count":3,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":9,"forks":1,"open_issues":9,"watchers":3,"default_branch":"master"}},"base":{"label":"Wikia:master","ref":"master","sha":"ec4dd61c2bc98d927051735bd73eadde61ae6289","user":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"repo":{"id":26663749,"name":"pandora","full_name":"Wikia/pandora","owner":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Wikia/pandora","description":"API Service","fork":false,"url":"https://api.github.com/repos/Wikia/pandora","forks_url":"https://api.github.com/repos/Wikia/pandora/forks","keys_url":"https://api.github.com/repos/Wikia/pandora/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Wikia/pandora/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Wikia/pandora/teams","hooks_url":"https://api.github.com/repos/Wikia/pandora/hooks","issue_events_url":"https://api.github.com/repos/Wikia/pandora/issues/events{/number}","events_url":"https://api.github.com/repos/Wikia/pandora/events","assignees_url":"https://api.github.com/repos/Wikia/pandora/assignees{/user}","branches_url":"https://api.github.com/repos/Wikia/pandora/branches{/branch}","tags_url":"https://api.github.com/repos/Wikia/pandora/tags","blobs_url":"https://api.github.com/repos/Wikia/pandora/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Wikia/pandora/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Wikia/pandora/git/refs{/sha}","trees_url":"https://api.github.com/repos/Wikia/pandora/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Wikia/pandora/statuses/{sha}","languages_url":"https://api.github.com/repos/Wikia/pandora/languages","stargazers_url":"https://api.github.com/repos/Wikia/pandora/stargazers","contributors_url":"https://api.github.com/repos/Wikia/pandora/contributors","subscribers_url":"https://api.github.com/repos/Wikia/pandora/subscribers","subscription_url":"https://api.github.com/repos/Wikia/pandora/subscription","commits_url":"https://api.github.com/repos/Wikia/pandora/commits{/sha}","git_commits_url":"https://api.github.com/repos/Wikia/pandora/git/commits{/sha}","comments_url":"https://api.github.com/repos/Wikia/pandora/comments{/number}","issue_comment_url":"https://api.github.com/repos/Wikia/pandora/issues/comments{/number}","contents_url":"https://api.github.com/repos/Wikia/pandora/contents/{+path}","compare_url":"https://api.github.com/repos/Wikia/pandora/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Wikia/pandora/merges","archive_url":"https://api.github.com/repos/Wikia/pandora/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Wikia/pandora/downloads","issues_url":"https://api.github.com/repos/Wikia/pandora/issues{/number}","pulls_url":"https://api.github.com/repos/Wikia/pandora/pulls{/number}","milestones_url":"https://api.github.com/repos/Wikia/pandora/milestones{/number}","notifications_url":"https://api.github.com/repos/Wikia/pandora/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Wikia/pandora/labels{/name}","releases_url":"https://api.github.com/repos/Wikia/pandora/releases{/id}","created_at":"2014-11-15T00:29:06Z","updated_at":"2015-11-04T16:44:11Z","pushed_at":"2015-11-20T12:29:04Z","git_url":"git://github.com/Wikia/pandora.git","ssh_url":"git@github.com:Wikia/pandora.git","clone_url":"https://github.com/Wikia/pandora.git","svn_url":"https://github.com/Wikia/pandora","homepage":null,"size":16933,"stargazers_count":3,"watchers_count":3,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":9,"forks":1,"open_issues":9,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Wikia/pandora/pulls/649"},"html":{"href":"https://github.com/Wikia/pandora/pull/649"},"issue":{"href":"https://api.github.com/repos/Wikia/pandora/issues/649"},"comments":{"href":"https://api.github.com/repos/Wikia/pandora/issues/649/comments"},"review_comments":{"href":"https://api.github.com/repos/Wikia/pandora/pulls/649/comments"},"review_comment":{"href":"https://api.github.com/repos/Wikia/pandora/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Wikia/pandora/pulls/649/commits"},"statuses":{"href":"https://api.github.com/repos/Wikia/pandora/statuses/2410ddad5bc245fddf2aaaed6003e3b07db0ca90"}}}}