{"action":"created","comment":{"url":"https://api.github.com/repos/insrchofsnrs/web-app/pulls/comments/225819613","pull_request_review_id":165501046,"id":225819613,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNTgxOTYxMw==","diff_hunk":"@@ -0,0 +1,52 @@\n+package by.insrchofsnrs.webapp.exception;\n+\n+import org.springframework.beans.factory.annotation.Autowired;\n+import org.springframework.core.convert.converter.Converter;\n+import org.springframework.http.HttpHeaders;\n+import org.springframework.http.HttpStatus;\n+import org.springframework.http.ResponseEntity;\n+import org.springframework.web.bind.MethodArgumentNotValidException;\n+import org.springframework.web.bind.annotation.ControllerAdvice;\n+import org.springframework.web.bind.annotation.ExceptionHandler;\n+import org.springframework.web.bind.annotation.RestController;\n+import org.springframework.web.context.request.WebRequest;\n+import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler;\n+\n+import java.util.Date;\n+import java.util.List;\n+\n+@ControllerAdvice\n+@RestController\n+public class CustomResponseEntityExceptionHandler extends ResponseEntityExceptionHandler {\n+\n+    @Autowired\n+    Converter<MethodArgumentNotValidException, List<InvalidFieldsUserDto>> converter;\n+\n+    @Override\n+    protected ResponseEntity<Object> handleMethodArgumentNotValid(MethodArgumentNotValidException ex,\n+                                                                  HttpHeaders headers,\n+                                                                  HttpStatus status,\n+                                                                  WebRequest request) {\n+\n+        ExceptionResponseUserValid exceptionResponse = new ExceptionResponseUserValid(new Date(),\n+               //\"Validation failed\",\n+                ex.getBindingResult().getAllErrors().stream().findFirst().get().getDefaultMessage(),","path":"src/main/java/by/insrchofsnrs/webapp/exception/CustomResponseEntityExceptionHandler.java","position":33,"original_position":33,"commit_id":"2deec60fbcb718430c6bd2d136952a6a7e3c4fb3","original_commit_id":"2deec60fbcb718430c6bd2d136952a6a7e3c4fb3","user":{"login":"CopKubar","id":21972554,"node_id":"MDQ6VXNlcjIxOTcyNTU0","avatar_url":"https://avatars1.githubusercontent.com/u/21972554?v=4","gravatar_id":"","url":"https://api.github.com/users/CopKubar","html_url":"https://github.com/CopKubar","followers_url":"https://api.github.com/users/CopKubar/followers","following_url":"https://api.github.com/users/CopKubar/following{/other_user}","gists_url":"https://api.github.com/users/CopKubar/gists{/gist_id}","starred_url":"https://api.github.com/users/CopKubar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CopKubar/subscriptions","organizations_url":"https://api.github.com/users/CopKubar/orgs","repos_url":"https://api.github.com/users/CopKubar/repos","events_url":"https://api.github.com/users/CopKubar/events{/privacy}","received_events_url":"https://api.github.com/users/CopKubar/received_events","type":"User","site_admin":false},"body":"что это делает? я правильно понял, что если будет несколько ошибок, я увижу только первую из списка?","created_at":"2018-10-17T08:08:49Z","updated_at":"2018-10-17T08:13:10Z","html_url":"https://github.com/insrchofsnrs/web-app/pull/2#discussion_r225819613","pull_request_url":"https://api.github.com/repos/insrchofsnrs/web-app/pulls/2","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/insrchofsnrs/web-app/pulls/comments/225819613"},"html":{"href":"https://github.com/insrchofsnrs/web-app/pull/2#discussion_r225819613"},"pull_request":{"href":"https://api.github.com/repos/insrchofsnrs/web-app/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/insrchofsnrs/web-app/pulls/2","id":221575565,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIxNTc1NTY1","html_url":"https://github.com/insrchofsnrs/web-app/pull/2","diff_url":"https://github.com/insrchofsnrs/web-app/pull/2.diff","patch_url":"https://github.com/insrchofsnrs/web-app/pull/2.patch","issue_url":"https://api.github.com/repos/insrchofsnrs/web-app/issues/2","number":2,"state":"open","locked":false,"title":"Validation etc.","user":{"login":"insrchofsnrs","id":29287684,"node_id":"MDQ6VXNlcjI5Mjg3Njg0","avatar_url":"https://avatars1.githubusercontent.com/u/29287684?v=4","gravatar_id":"","url":"https://api.github.com/users/insrchofsnrs","html_url":"https://github.com/insrchofsnrs","followers_url":"https://api.github.com/users/insrchofsnrs/followers","following_url":"https://api.github.com/users/insrchofsnrs/following{/other_user}","gists_url":"https://api.github.com/users/insrchofsnrs/gists{/gist_id}","starred_url":"https://api.github.com/users/insrchofsnrs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/insrchofsnrs/subscriptions","organizations_url":"https://api.github.com/users/insrchofsnrs/orgs","repos_url":"https://api.github.com/users/insrchofsnrs/repos","events_url":"https://api.github.com/users/insrchofsnrs/events{/privacy}","received_events_url":"https://api.github.com/users/insrchofsnrs/received_events","type":"User","site_admin":false},"body":"Validation\r\nCustom exceptions","created_at":"2018-10-09T20:31:31Z","updated_at":"2018-10-17T08:13:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a14af865c1b5db862bb4dd8ecfa3d20cf904385a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/insrchofsnrs/web-app/pulls/2/commits","review_comments_url":"https://api.github.com/repos/insrchofsnrs/web-app/pulls/2/comments","review_comment_url":"https://api.github.com/repos/insrchofsnrs/web-app/pulls/comments{/number}","comments_url":"https://api.github.com/repos/insrchofsnrs/web-app/issues/2/comments","statuses_url":"https://api.github.com/repos/insrchofsnrs/web-app/statuses/2deec60fbcb718430c6bd2d136952a6a7e3c4fb3","head":{"label":"insrchofsnrs:dev","ref":"dev","sha":"2deec60fbcb718430c6bd2d136952a6a7e3c4fb3","user":{"login":"insrchofsnrs","id":29287684,"node_id":"MDQ6VXNlcjI5Mjg3Njg0","avatar_url":"https://avatars1.githubusercontent.com/u/29287684?v=4","gravatar_id":"","url":"https://api.github.com/users/insrchofsnrs","html_url":"https://github.com/insrchofsnrs","followers_url":"https://api.github.com/users/insrchofsnrs/followers","following_url":"https://api.github.com/users/insrchofsnrs/following{/other_user}","gists_url":"https://api.github.com/users/insrchofsnrs/gists{/gist_id}","starred_url":"https://api.github.com/users/insrchofsnrs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/insrchofsnrs/subscriptions","organizations_url":"https://api.github.com/users/insrchofsnrs/orgs","repos_url":"https://api.github.com/users/insrchofsnrs/repos","events_url":"https://api.github.com/users/insrchofsnrs/events{/privacy}","received_events_url":"https://api.github.com/users/insrchofsnrs/received_events","type":"User","site_admin":false},"repo":{"id":149748179,"node_id":"MDEwOlJlcG9zaXRvcnkxNDk3NDgxNzk=","name":"web-app","full_name":"insrchofsnrs/web-app","private":false,"owner":{"login":"insrchofsnrs","id":29287684,"node_id":"MDQ6VXNlcjI5Mjg3Njg0","avatar_url":"https://avatars1.githubusercontent.com/u/29287684?v=4","gravatar_id":"","url":"https://api.github.com/users/insrchofsnrs","html_url":"https://github.com/insrchofsnrs","followers_url":"https://api.github.com/users/insrchofsnrs/followers","following_url":"https://api.github.com/users/insrchofsnrs/following{/other_user}","gists_url":"https://api.github.com/users/insrchofsnrs/gists{/gist_id}","starred_url":"https://api.github.com/users/insrchofsnrs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/insrchofsnrs/subscriptions","organizations_url":"https://api.github.com/users/insrchofsnrs/orgs","repos_url":"https://api.github.com/users/insrchofsnrs/repos","events_url":"https://api.github.com/users/insrchofsnrs/events{/privacy}","received_events_url":"https://api.github.com/users/insrchofsnrs/received_events","type":"User","site_admin":false},"html_url":"https://github.com/insrchofsnrs/web-app","description":"webapp","fork":false,"url":"https://api.github.com/repos/insrchofsnrs/web-app","forks_url":"https://api.github.com/repos/insrchofsnrs/web-app/forks","keys_url":"https://api.github.com/repos/insrchofsnrs/web-app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/insrchofsnrs/web-app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/insrchofsnrs/web-app/teams","hooks_url":"https://api.github.com/repos/insrchofsnrs/web-app/hooks","issue_events_url":"https://api.github.com/repos/insrchofsnrs/web-app/issues/events{/number}","events_url":"https://api.github.com/repos/insrchofsnrs/web-app/events","assignees_url":"https://api.github.com/repos/insrchofsnrs/web-app/assignees{/user}","branches_url":"https://api.github.com/repos/insrchofsnrs/web-app/branches{/branch}","tags_url":"https://api.github.com/repos/insrchofsnrs/web-app/tags","blobs_url":"https://api.github.com/repos/insrchofsnrs/web-app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/insrchofsnrs/web-app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/insrchofsnrs/web-app/git/refs{/sha}","trees_url":"https://api.github.com/repos/insrchofsnrs/web-app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/insrchofsnrs/web-app/statuses/{sha}","languages_url":"https://api.github.com/repos/insrchofsnrs/web-app/languages","stargazers_url":"https://api.github.com/repos/insrchofsnrs/web-app/stargazers","contributors_url":"https://api.github.com/repos/insrchofsnrs/web-app/contributors","subscribers_url":"https://api.github.com/repos/insrchofsnrs/web-app/subscribers","subscription_url":"https://api.github.com/repos/insrchofsnrs/web-app/subscription","commits_url":"https://api.github.com/repos/insrchofsnrs/web-app/commits{/sha}","git_commits_url":"https://api.github.com/repos/insrchofsnrs/web-app/git/commits{/sha}","comments_url":"https://api.github.com/repos/insrchofsnrs/web-app/comments{/number}","issue_comment_url":"https://api.github.com/repos/insrchofsnrs/web-app/issues/comments{/number}","contents_url":"https://api.github.com/repos/insrchofsnrs/web-app/contents/{+path}","compare_url":"https://api.github.com/repos/insrchofsnrs/web-app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/insrchofsnrs/web-app/merges","archive_url":"https://api.github.com/repos/insrchofsnrs/web-app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/insrchofsnrs/web-app/downloads","issues_url":"https://api.github.com/repos/insrchofsnrs/web-app/issues{/number}","pulls_url":"https://api.github.com/repos/insrchofsnrs/web-app/pulls{/number}","milestones_url":"https://api.github.com/repos/insrchofsnrs/web-app/milestones{/number}","notifications_url":"https://api.github.com/repos/insrchofsnrs/web-app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/insrchofsnrs/web-app/labels{/name}","releases_url":"https://api.github.com/repos/insrchofsnrs/web-app/releases{/id}","deployments_url":"https://api.github.com/repos/insrchofsnrs/web-app/deployments","created_at":"2018-09-21T10:24:55Z","updated_at":"2018-09-21T10:25:28Z","pushed_at":"2018-10-16T21:34:30Z","git_url":"git://github.com/insrchofsnrs/web-app.git","ssh_url":"git@github.com:insrchofsnrs/web-app.git","clone_url":"https://github.com/insrchofsnrs/web-app.git","svn_url":"https://github.com/insrchofsnrs/web-app","homepage":null,"size":88,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"insrchofsnrs:prod","ref":"prod","sha":"4c836568b6fd6b1ec60ca1e23aa8ede436175ed6","user":{"login":"insrchofsnrs","id":29287684,"node_id":"MDQ6VXNlcjI5Mjg3Njg0","avatar_url":"https://avatars1.githubusercontent.com/u/29287684?v=4","gravatar_id":"","url":"https://api.github.com/users/insrchofsnrs","html_url":"https://github.com/insrchofsnrs","followers_url":"https://api.github.com/users/insrchofsnrs/followers","following_url":"https://api.github.com/users/insrchofsnrs/following{/other_user}","gists_url":"https://api.github.com/users/insrchofsnrs/gists{/gist_id}","starred_url":"https://api.github.com/users/insrchofsnrs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/insrchofsnrs/subscriptions","organizations_url":"https://api.github.com/users/insrchofsnrs/orgs","repos_url":"https://api.github.com/users/insrchofsnrs/repos","events_url":"https://api.github.com/users/insrchofsnrs/events{/privacy}","received_events_url":"https://api.github.com/users/insrchofsnrs/received_events","type":"User","site_admin":false},"repo":{"id":149748179,"node_id":"MDEwOlJlcG9zaXRvcnkxNDk3NDgxNzk=","name":"web-app","full_name":"insrchofsnrs/web-app","private":false,"owner":{"login":"insrchofsnrs","id":29287684,"node_id":"MDQ6VXNlcjI5Mjg3Njg0","avatar_url":"https://avatars1.githubusercontent.com/u/29287684?v=4","gravatar_id":"","url":"https://api.github.com/users/insrchofsnrs","html_url":"https://github.com/insrchofsnrs","followers_url":"https://api.github.com/users/insrchofsnrs/followers","following_url":"https://api.github.com/users/insrchofsnrs/following{/other_user}","gists_url":"https://api.github.com/users/insrchofsnrs/gists{/gist_id}","starred_url":"https://api.github.com/users/insrchofsnrs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/insrchofsnrs/subscriptions","organizations_url":"https://api.github.com/users/insrchofsnrs/orgs","repos_url":"https://api.github.com/users/insrchofsnrs/repos","events_url":"https://api.github.com/users/insrchofsnrs/events{/privacy}","received_events_url":"https://api.github.com/users/insrchofsnrs/received_events","type":"User","site_admin":false},"html_url":"https://github.com/insrchofsnrs/web-app","description":"webapp","fork":false,"url":"https://api.github.com/repos/insrchofsnrs/web-app","forks_url":"https://api.github.com/repos/insrchofsnrs/web-app/forks","keys_url":"https://api.github.com/repos/insrchofsnrs/web-app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/insrchofsnrs/web-app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/insrchofsnrs/web-app/teams","hooks_url":"https://api.github.com/repos/insrchofsnrs/web-app/hooks","issue_events_url":"https://api.github.com/repos/insrchofsnrs/web-app/issues/events{/number}","events_url":"https://api.github.com/repos/insrchofsnrs/web-app/events","assignees_url":"https://api.github.com/repos/insrchofsnrs/web-app/assignees{/user}","branches_url":"https://api.github.com/repos/insrchofsnrs/web-app/branches{/branch}","tags_url":"https://api.github.com/repos/insrchofsnrs/web-app/tags","blobs_url":"https://api.github.com/repos/insrchofsnrs/web-app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/insrchofsnrs/web-app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/insrchofsnrs/web-app/git/refs{/sha}","trees_url":"https://api.github.com/repos/insrchofsnrs/web-app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/insrchofsnrs/web-app/statuses/{sha}","languages_url":"https://api.github.com/repos/insrchofsnrs/web-app/languages","stargazers_url":"https://api.github.com/repos/insrchofsnrs/web-app/stargazers","contributors_url":"https://api.github.com/repos/insrchofsnrs/web-app/contributors","subscribers_url":"https://api.github.com/repos/insrchofsnrs/web-app/subscribers","subscription_url":"https://api.github.com/repos/insrchofsnrs/web-app/subscription","commits_url":"https://api.github.com/repos/insrchofsnrs/web-app/commits{/sha}","git_commits_url":"https://api.github.com/repos/insrchofsnrs/web-app/git/commits{/sha}","comments_url":"https://api.github.com/repos/insrchofsnrs/web-app/comments{/number}","issue_comment_url":"https://api.github.com/repos/insrchofsnrs/web-app/issues/comments{/number}","contents_url":"https://api.github.com/repos/insrchofsnrs/web-app/contents/{+path}","compare_url":"https://api.github.com/repos/insrchofsnrs/web-app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/insrchofsnrs/web-app/merges","archive_url":"https://api.github.com/repos/insrchofsnrs/web-app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/insrchofsnrs/web-app/downloads","issues_url":"https://api.github.com/repos/insrchofsnrs/web-app/issues{/number}","pulls_url":"https://api.github.com/repos/insrchofsnrs/web-app/pulls{/number}","milestones_url":"https://api.github.com/repos/insrchofsnrs/web-app/milestones{/number}","notifications_url":"https://api.github.com/repos/insrchofsnrs/web-app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/insrchofsnrs/web-app/labels{/name}","releases_url":"https://api.github.com/repos/insrchofsnrs/web-app/releases{/id}","deployments_url":"https://api.github.com/repos/insrchofsnrs/web-app/deployments","created_at":"2018-09-21T10:24:55Z","updated_at":"2018-09-21T10:25:28Z","pushed_at":"2018-10-16T21:34:30Z","git_url":"git://github.com/insrchofsnrs/web-app.git","ssh_url":"git@github.com:insrchofsnrs/web-app.git","clone_url":"https://github.com/insrchofsnrs/web-app.git","svn_url":"https://github.com/insrchofsnrs/web-app","homepage":null,"size":88,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/insrchofsnrs/web-app/pulls/2"},"html":{"href":"https://github.com/insrchofsnrs/web-app/pull/2"},"issue":{"href":"https://api.github.com/repos/insrchofsnrs/web-app/issues/2"},"comments":{"href":"https://api.github.com/repos/insrchofsnrs/web-app/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/insrchofsnrs/web-app/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/insrchofsnrs/web-app/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/insrchofsnrs/web-app/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/insrchofsnrs/web-app/statuses/2deec60fbcb718430c6bd2d136952a6a7e3c4fb3"}},"author_association":"OWNER"}}
{"actor":{"display_login":"CopKubar"}}