{"action":"created","issue":{"url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/issues/55","labels_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/issues/55/labels{/name}","comments_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/issues/55/comments","events_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/issues/55/events","html_url":"https://github.com/codeclimate/codeclimate-duplication/pull/55","id":122837961,"number":55,"title":"rescue less","user":{"login":"wfleming","id":188402,"avatar_url":"https://avatars.githubusercontent.com/u/188402?v=3","gravatar_id":"","url":"https://api.github.com/users/wfleming","html_url":"https://github.com/wfleming","followers_url":"https://api.github.com/users/wfleming/followers","following_url":"https://api.github.com/users/wfleming/following{/other_user}","gists_url":"https://api.github.com/users/wfleming/gists{/gist_id}","starred_url":"https://api.github.com/users/wfleming/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wfleming/subscriptions","organizations_url":"https://api.github.com/users/wfleming/orgs","repos_url":"https://api.github.com/users/wfleming/repos","events_url":"https://api.github.com/users/wfleming/events{/privacy}","received_events_url":"https://api.github.com/users/wfleming/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-17T22:34:45Z","updated_at":"2015-12-17T22:40:52Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/pulls/55","html_url":"https://github.com/codeclimate/codeclimate-duplication/pull/55","diff_url":"https://github.com/codeclimate/codeclimate-duplication/pull/55.diff","patch_url":"https://github.com/codeclimate/codeclimate-duplication/pull/55.patch"},"body":"The Analyzer `#run` loop was rescuing *all* exceptions, which is clearly\r\nexcessive. But I don't think we should hard-fail on all exceptions, either:\r\nthe Ruby parser gem is definitely known to barf on some valid but\r\nesoteric Ruby code, and I wouldn't be surprised if the other parsers had\r\nsimilar edge cases.\r\n\r\nSo this changes behavior to only skip files for a known set of catchable\r\nerrors. The out-of-process parsers are a little tricky since all you can\r\nget from them is an exit code and output streams: for now wrapping any non-zero exit from them\r\nin our own exception class seems reasonable. They're not effected by Java heap problems, and since we don't control the heap anymore, any potential memory problems should kill the whole container with OOM.\r\n\r\nI'm still catching all exceptions, but only so that we can log a message\r\nabout which file is impacted before we re-raise. Since a raw exception\r\nthat will cause an abort may not contain helpful information about the file\r\nthat triggered it, this would be helpful for debugging cases.\r\n\r\nNote that there is a similar case of an excessive `rescue` in the `FileThreadPool`. I'm investigating & fixing that separately.\r\n\r\nThoughts, @codeclimate/review ?"},"comment":{"url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/issues/comments/165605125","html_url":"https://github.com/codeclimate/codeclimate-duplication/pull/55#issuecomment-165605125","issue_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/issues/55","id":165605125,"user":{"login":"dblandin","id":123595,"avatar_url":"https://avatars.githubusercontent.com/u/123595?v=3","gravatar_id":"","url":"https://api.github.com/users/dblandin","html_url":"https://github.com/dblandin","followers_url":"https://api.github.com/users/dblandin/followers","following_url":"https://api.github.com/users/dblandin/following{/other_user}","gists_url":"https://api.github.com/users/dblandin/gists{/gist_id}","starred_url":"https://api.github.com/users/dblandin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dblandin/subscriptions","organizations_url":"https://api.github.com/users/dblandin/orgs","repos_url":"https://api.github.com/users/dblandin/repos","events_url":"https://api.github.com/users/dblandin/events{/privacy}","received_events_url":"https://api.github.com/users/dblandin/received_events","type":"User","site_admin":false},"created_at":"2015-12-17T22:40:52Z","updated_at":"2015-12-17T22:40:52Z","body":"This looks like a great approach :+1: "}}