{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/2526","repository_url":"https://api.github.com/repos/ansible/ansible-modules-core","labels_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/2526/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/2526/comments","events_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/2526/events","html_url":"https://github.com/ansible/ansible-modules-core/issues/2526","id":118451975,"number":2526,"title":"Nonexistent exception in ec2_asg.py","user":{"login":"shawnsi","id":55750,"avatar_url":"https://avatars.githubusercontent.com/u/55750?v=3","gravatar_id":"","url":"https://api.github.com/users/shawnsi","html_url":"https://github.com/shawnsi","followers_url":"https://api.github.com/users/shawnsi/followers","following_url":"https://api.github.com/users/shawnsi/following{/other_user}","gists_url":"https://api.github.com/users/shawnsi/gists{/gist_id}","starred_url":"https://api.github.com/users/shawnsi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shawnsi/subscriptions","organizations_url":"https://api.github.com/users/shawnsi/orgs","repos_url":"https://api.github.com/users/shawnsi/repos","events_url":"https://api.github.com/users/shawnsi/events{/privacy}","received_events_url":"https://api.github.com/users/shawnsi/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/bug_report","name":"bug_report","color":"fbca04"},{"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/cloud","name":"cloud","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-11-23T19:18:23Z","updated_at":"2016-02-08T14:48:01Z","closed_at":null,"body":"The EC2 autoscaling module tries to catch a nonexist exception `boto.exception.InvalidInstance` at https://github.com/ansible/ansible-modules-core/commit/b2df875e78d6be12409bf7a3926c005b23993170#diff-689b2e5ce09076c21c9915e50f8a9140R292.  This should be handled like https://github.com/ansible/ansible-modules-core/blob/devel/cloud/amazon/ec2_elb.py#L243 instead."},"comment":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/comments/181404347","html_url":"https://github.com/ansible/ansible-modules-core/issues/2526#issuecomment-181404347","issue_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/2526","id":181404347,"user":{"login":"jonhadfield","id":843944,"avatar_url":"https://avatars.githubusercontent.com/u/843944?v=3","gravatar_id":"","url":"https://api.github.com/users/jonhadfield","html_url":"https://github.com/jonhadfield","followers_url":"https://api.github.com/users/jonhadfield/followers","following_url":"https://api.github.com/users/jonhadfield/following{/other_user}","gists_url":"https://api.github.com/users/jonhadfield/gists{/gist_id}","starred_url":"https://api.github.com/users/jonhadfield/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonhadfield/subscriptions","organizations_url":"https://api.github.com/users/jonhadfield/orgs","repos_url":"https://api.github.com/users/jonhadfield/repos","events_url":"https://api.github.com/users/jonhadfield/events{/privacy}","received_events_url":"https://api.github.com/users/jonhadfield/received_events","type":"User","site_admin":false},"created_at":"2016-02-08T14:48:01Z","updated_at":"2016-02-08T14:48:01Z","body":"I've also hit this error in a situation where an ASG has an ELB associated (it will spin up new instances behind) that does not exist, it should be catching 'boto.exception.BotoServerError' with code: 'LoadBalancerNotFound', but instead raises the AttributeError.\r\n@shawnsi I've not been through all the module code, but I'd suggest the fix should be to have a module.fail_json with a relevant message rather than performing a pass for what would be a legitimate error. Instead of just raising, you could use the same but just provide the error_code value as the message?\r\n"}}