{"action":"created","comment":{"url":"https://api.github.com/repos/codingmentor/homeworks/pulls/comments/75909359","id":75909359,"diff_hunk":"@@ -0,0 +1,27 @@\n+package hu.oktatas.java.ee.webshop.exceptionmapper;\n+\n+import javax.inject.Inject;\n+import javax.ws.rs.core.Response;\n+import javax.ws.rs.ext.ExceptionMapper;\n+import javax.ws.rs.ext.Provider;\n+import java.util.logging.Level;\n+import java.util.logging.Logger;\n+import static javax.ws.rs.core.MediaType.APPLICATION_JSON;\n+import static javax.ws.rs.core.Response.Status.INTERNAL_SERVER_ERROR;\n+\n+@Provider\n+public class GeneralExceptionMapper implements ExceptionMapper<Throwable> {\n+\n+    @Inject\n+    private Logger logger;\n+\n+    @Override\n+    public Response toResponse(Throwable throwable) {\n+        logger.log(Level.SEVERE, \"General Exception\", throwable);\n+        return Response.status(INTERNAL_SERVER_ERROR)","path":"balazs.horvath/2-homework-webshop/2-homework-webshop-web/src/main/java/hu/oktatas/java/ee/webshop/exceptionmapper/GeneralExceptionMapper.java","position":21,"original_position":21,"commit_id":"ece4a34c19ab36016a5e2f4c0052a55b05983236","original_commit_id":"ece4a34c19ab36016a5e2f4c0052a55b05983236","user":{"login":"deneslaszlo","id":16327999,"avatar_url":"https://avatars.githubusercontent.com/u/16327999?v=3","gravatar_id":"","url":"https://api.github.com/users/deneslaszlo","html_url":"https://github.com/deneslaszlo","followers_url":"https://api.github.com/users/deneslaszlo/followers","following_url":"https://api.github.com/users/deneslaszlo/following{/other_user}","gists_url":"https://api.github.com/users/deneslaszlo/gists{/gist_id}","starred_url":"https://api.github.com/users/deneslaszlo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deneslaszlo/subscriptions","organizations_url":"https://api.github.com/users/deneslaszlo/orgs","repos_url":"https://api.github.com/users/deneslaszlo/repos","events_url":"https://api.github.com/users/deneslaszlo/events{/privacy}","received_events_url":"https://api.github.com/users/deneslaszlo/received_events","type":"User","site_admin":false},"body":"Nincs külön exceptionMapper a saját exceptionökre, így igazából bármilyen hiba történik, a kliens csak azt látja, hogy internal server error van. Akkor is, ha a szerver tudja, hogy a kliens rontotta el a kérést, de így ezt az információt nem adja át. Legyen saját exceptionökre exceptionMapper, ahol a statusban jelzed, hogy a kliens kérés a rossz, nem a szerver hibájából nem sikerült a feldolgozás. (pl UsernameNotExistException)","created_at":"2016-08-23T17:07:36Z","updated_at":"2016-08-23T17:07:36Z","html_url":"https://github.com/codingmentor/homeworks/pull/54#discussion_r75909359","pull_request_url":"https://api.github.com/repos/codingmentor/homeworks/pulls/54","_links":{"self":{"href":"https://api.github.com/repos/codingmentor/homeworks/pulls/comments/75909359"},"html":{"href":"https://github.com/codingmentor/homeworks/pull/54#discussion_r75909359"},"pull_request":{"href":"https://api.github.com/repos/codingmentor/homeworks/pulls/54"}}},"pull_request":{"url":"https://api.github.com/repos/codingmentor/homeworks/pulls/54","id":80540420,"html_url":"https://github.com/codingmentor/homeworks/pull/54","diff_url":"https://github.com/codingmentor/homeworks/pull/54.diff","patch_url":"https://github.com/codingmentor/homeworks/pull/54.patch","issue_url":"https://api.github.com/repos/codingmentor/homeworks/issues/54","number":54,"state":"open","locked":false,"title":"EE-2/2","user":{"login":"balazs630","id":11799971,"avatar_url":"https://avatars.githubusercontent.com/u/11799971?v=3","gravatar_id":"","url":"https://api.github.com/users/balazs630","html_url":"https://github.com/balazs630","followers_url":"https://api.github.com/users/balazs630/followers","following_url":"https://api.github.com/users/balazs630/following{/other_user}","gists_url":"https://api.github.com/users/balazs630/gists{/gist_id}","starred_url":"https://api.github.com/users/balazs630/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balazs630/subscriptions","organizations_url":"https://api.github.com/users/balazs630/orgs","repos_url":"https://api.github.com/users/balazs630/repos","events_url":"https://api.github.com/users/balazs630/events{/privacy}","received_events_url":"https://api.github.com/users/balazs630/received_events","type":"User","site_admin":false},"body":"Kérlek nézd át hogy amivel bővítettem a kódot az rendben van-e.\r\nAzt hogy a felhasználó admin-e vagy sem azt validátorral kéne ellenőriznem?","created_at":"2016-08-08T23:43:22Z","updated_at":"2016-08-23T17:07:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/codingmentor/homeworks/pulls/54/commits","review_comments_url":"https://api.github.com/repos/codingmentor/homeworks/pulls/54/comments","review_comment_url":"https://api.github.com/repos/codingmentor/homeworks/pulls/comments{/number}","comments_url":"https://api.github.com/repos/codingmentor/homeworks/issues/54/comments","statuses_url":"https://api.github.com/repos/codingmentor/homeworks/statuses/ece4a34c19ab36016a5e2f4c0052a55b05983236","head":{"label":"balazs630:EE-2/2","ref":"EE-2/2","sha":"ece4a34c19ab36016a5e2f4c0052a55b05983236","user":{"login":"balazs630","id":11799971,"avatar_url":"https://avatars.githubusercontent.com/u/11799971?v=3","gravatar_id":"","url":"https://api.github.com/users/balazs630","html_url":"https://github.com/balazs630","followers_url":"https://api.github.com/users/balazs630/followers","following_url":"https://api.github.com/users/balazs630/following{/other_user}","gists_url":"https://api.github.com/users/balazs630/gists{/gist_id}","starred_url":"https://api.github.com/users/balazs630/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balazs630/subscriptions","organizations_url":"https://api.github.com/users/balazs630/orgs","repos_url":"https://api.github.com/users/balazs630/repos","events_url":"https://api.github.com/users/balazs630/events{/privacy}","received_events_url":"https://api.github.com/users/balazs630/received_events","type":"User","site_admin":false},"repo":{"id":63486489,"name":"homeworks","full_name":"balazs630/homeworks","owner":{"login":"balazs630","id":11799971,"avatar_url":"https://avatars.githubusercontent.com/u/11799971?v=3","gravatar_id":"","url":"https://api.github.com/users/balazs630","html_url":"https://github.com/balazs630","followers_url":"https://api.github.com/users/balazs630/followers","following_url":"https://api.github.com/users/balazs630/following{/other_user}","gists_url":"https://api.github.com/users/balazs630/gists{/gist_id}","starred_url":"https://api.github.com/users/balazs630/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balazs630/subscriptions","organizations_url":"https://api.github.com/users/balazs630/orgs","repos_url":"https://api.github.com/users/balazs630/repos","events_url":"https://api.github.com/users/balazs630/events{/privacy}","received_events_url":"https://api.github.com/users/balazs630/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/balazs630/homeworks","description":"Homeworks of codingmentor training","fork":true,"url":"https://api.github.com/repos/balazs630/homeworks","forks_url":"https://api.github.com/repos/balazs630/homeworks/forks","keys_url":"https://api.github.com/repos/balazs630/homeworks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/balazs630/homeworks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/balazs630/homeworks/teams","hooks_url":"https://api.github.com/repos/balazs630/homeworks/hooks","issue_events_url":"https://api.github.com/repos/balazs630/homeworks/issues/events{/number}","events_url":"https://api.github.com/repos/balazs630/homeworks/events","assignees_url":"https://api.github.com/repos/balazs630/homeworks/assignees{/user}","branches_url":"https://api.github.com/repos/balazs630/homeworks/branches{/branch}","tags_url":"https://api.github.com/repos/balazs630/homeworks/tags","blobs_url":"https://api.github.com/repos/balazs630/homeworks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/balazs630/homeworks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/balazs630/homeworks/git/refs{/sha}","trees_url":"https://api.github.com/repos/balazs630/homeworks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/balazs630/homeworks/statuses/{sha}","languages_url":"https://api.github.com/repos/balazs630/homeworks/languages","stargazers_url":"https://api.github.com/repos/balazs630/homeworks/stargazers","contributors_url":"https://api.github.com/repos/balazs630/homeworks/contributors","subscribers_url":"https://api.github.com/repos/balazs630/homeworks/subscribers","subscription_url":"https://api.github.com/repos/balazs630/homeworks/subscription","commits_url":"https://api.github.com/repos/balazs630/homeworks/commits{/sha}","git_commits_url":"https://api.github.com/repos/balazs630/homeworks/git/commits{/sha}","comments_url":"https://api.github.com/repos/balazs630/homeworks/comments{/number}","issue_comment_url":"https://api.github.com/repos/balazs630/homeworks/issues/comments{/number}","contents_url":"https://api.github.com/repos/balazs630/homeworks/contents/{+path}","compare_url":"https://api.github.com/repos/balazs630/homeworks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/balazs630/homeworks/merges","archive_url":"https://api.github.com/repos/balazs630/homeworks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/balazs630/homeworks/downloads","issues_url":"https://api.github.com/repos/balazs630/homeworks/issues{/number}","pulls_url":"https://api.github.com/repos/balazs630/homeworks/pulls{/number}","milestones_url":"https://api.github.com/repos/balazs630/homeworks/milestones{/number}","notifications_url":"https://api.github.com/repos/balazs630/homeworks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/balazs630/homeworks/labels{/name}","releases_url":"https://api.github.com/repos/balazs630/homeworks/releases{/id}","deployments_url":"https://api.github.com/repos/balazs630/homeworks/deployments","created_at":"2016-07-16T14:26:14Z","updated_at":"2016-07-16T14:00:02Z","pushed_at":"2016-08-23T12:08:15Z","git_url":"git://github.com/balazs630/homeworks.git","ssh_url":"git@github.com:balazs630/homeworks.git","clone_url":"https://github.com/balazs630/homeworks.git","svn_url":"https://github.com/balazs630/homeworks","homepage":null,"size":140,"stargazers_count":0,"watchers_count":0,"language":null,"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":"codingmentor:balazs.horvath","ref":"balazs.horvath","sha":"c858516574861ae9da2541931fdf4a36a6ce7c5e","user":{"login":"codingmentor","id":17640460,"avatar_url":"https://avatars.githubusercontent.com/u/17640460?v=3","gravatar_id":"","url":"https://api.github.com/users/codingmentor","html_url":"https://github.com/codingmentor","followers_url":"https://api.github.com/users/codingmentor/followers","following_url":"https://api.github.com/users/codingmentor/following{/other_user}","gists_url":"https://api.github.com/users/codingmentor/gists{/gist_id}","starred_url":"https://api.github.com/users/codingmentor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codingmentor/subscriptions","organizations_url":"https://api.github.com/users/codingmentor/orgs","repos_url":"https://api.github.com/users/codingmentor/repos","events_url":"https://api.github.com/users/codingmentor/events{/privacy}","received_events_url":"https://api.github.com/users/codingmentor/received_events","type":"Organization","site_admin":false},"repo":{"id":63485226,"name":"homeworks","full_name":"codingmentor/homeworks","owner":{"login":"codingmentor","id":17640460,"avatar_url":"https://avatars.githubusercontent.com/u/17640460?v=3","gravatar_id":"","url":"https://api.github.com/users/codingmentor","html_url":"https://github.com/codingmentor","followers_url":"https://api.github.com/users/codingmentor/followers","following_url":"https://api.github.com/users/codingmentor/following{/other_user}","gists_url":"https://api.github.com/users/codingmentor/gists{/gist_id}","starred_url":"https://api.github.com/users/codingmentor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codingmentor/subscriptions","organizations_url":"https://api.github.com/users/codingmentor/orgs","repos_url":"https://api.github.com/users/codingmentor/repos","events_url":"https://api.github.com/users/codingmentor/events{/privacy}","received_events_url":"https://api.github.com/users/codingmentor/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/codingmentor/homeworks","description":"Homeworks of codingmentor training","fork":false,"url":"https://api.github.com/repos/codingmentor/homeworks","forks_url":"https://api.github.com/repos/codingmentor/homeworks/forks","keys_url":"https://api.github.com/repos/codingmentor/homeworks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codingmentor/homeworks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codingmentor/homeworks/teams","hooks_url":"https://api.github.com/repos/codingmentor/homeworks/hooks","issue_events_url":"https://api.github.com/repos/codingmentor/homeworks/issues/events{/number}","events_url":"https://api.github.com/repos/codingmentor/homeworks/events","assignees_url":"https://api.github.com/repos/codingmentor/homeworks/assignees{/user}","branches_url":"https://api.github.com/repos/codingmentor/homeworks/branches{/branch}","tags_url":"https://api.github.com/repos/codingmentor/homeworks/tags","blobs_url":"https://api.github.com/repos/codingmentor/homeworks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codingmentor/homeworks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codingmentor/homeworks/git/refs{/sha}","trees_url":"https://api.github.com/repos/codingmentor/homeworks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codingmentor/homeworks/statuses/{sha}","languages_url":"https://api.github.com/repos/codingmentor/homeworks/languages","stargazers_url":"https://api.github.com/repos/codingmentor/homeworks/stargazers","contributors_url":"https://api.github.com/repos/codingmentor/homeworks/contributors","subscribers_url":"https://api.github.com/repos/codingmentor/homeworks/subscribers","subscription_url":"https://api.github.com/repos/codingmentor/homeworks/subscription","commits_url":"https://api.github.com/repos/codingmentor/homeworks/commits{/sha}","git_commits_url":"https://api.github.com/repos/codingmentor/homeworks/git/commits{/sha}","comments_url":"https://api.github.com/repos/codingmentor/homeworks/comments{/number}","issue_comment_url":"https://api.github.com/repos/codingmentor/homeworks/issues/comments{/number}","contents_url":"https://api.github.com/repos/codingmentor/homeworks/contents/{+path}","compare_url":"https://api.github.com/repos/codingmentor/homeworks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codingmentor/homeworks/merges","archive_url":"https://api.github.com/repos/codingmentor/homeworks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codingmentor/homeworks/downloads","issues_url":"https://api.github.com/repos/codingmentor/homeworks/issues{/number}","pulls_url":"https://api.github.com/repos/codingmentor/homeworks/pulls{/number}","milestones_url":"https://api.github.com/repos/codingmentor/homeworks/milestones{/number}","notifications_url":"https://api.github.com/repos/codingmentor/homeworks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codingmentor/homeworks/labels{/name}","releases_url":"https://api.github.com/repos/codingmentor/homeworks/releases{/id}","deployments_url":"https://api.github.com/repos/codingmentor/homeworks/deployments","created_at":"2016-07-16T13:54:09Z","updated_at":"2016-08-08T18:38:22Z","pushed_at":"2016-08-23T12:08:15Z","git_url":"git://github.com/codingmentor/homeworks.git","ssh_url":"git@github.com:codingmentor/homeworks.git","clone_url":"https://github.com/codingmentor/homeworks.git","svn_url":"https://github.com/codingmentor/homeworks","homepage":null,"size":2404,"stargazers_count":1,"watchers_count":1,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":7,"forks":12,"open_issues":7,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/codingmentor/homeworks/pulls/54"},"html":{"href":"https://github.com/codingmentor/homeworks/pull/54"},"issue":{"href":"https://api.github.com/repos/codingmentor/homeworks/issues/54"},"comments":{"href":"https://api.github.com/repos/codingmentor/homeworks/issues/54/comments"},"review_comments":{"href":"https://api.github.com/repos/codingmentor/homeworks/pulls/54/comments"},"review_comment":{"href":"https://api.github.com/repos/codingmentor/homeworks/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/codingmentor/homeworks/pulls/54/commits"},"statuses":{"href":"https://api.github.com/repos/codingmentor/homeworks/statuses/ece4a34c19ab36016a5e2f4c0052a55b05983236"}}}}
{"actor":{"display_login":"deneslaszlo"}}