{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/12341","labels_url":"https://api.github.com/repos/ansible/ansible/issues/12341/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/12341/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/12341/events","html_url":"https://github.com/ansible/ansible/issues/12341","id":106231235,"number":12341,"title":"add last error to rescue block","user":{"login":"kai11","id":5407282,"avatar_url":"https://avatars.githubusercontent.com/u/5407282?v=3","gravatar_id":"","url":"https://api.github.com/users/kai11","html_url":"https://github.com/kai11","followers_url":"https://api.github.com/users/kai11/followers","following_url":"https://api.github.com/users/kai11/following{/other_user}","gists_url":"https://api.github.com/users/kai11/gists{/gist_id}","starred_url":"https://api.github.com/users/kai11/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kai11/subscriptions","organizations_url":"https://api.github.com/users/kai11/orgs","repos_url":"https://api.github.com/users/kai11/repos","events_url":"https://api.github.com/users/kai11/events{/privacy}","received_events_url":"https://api.github.com/users/kai11/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ansible/ansible/labels/feature_idea","name":"feature_idea","color":"006b75"},{"url":"https://api.github.com/repos/ansible/ansible/labels/P3","name":"P3","color":"fef2c0"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-13T18:28:48Z","updated_at":"2015-09-16T20:54:24Z","closed_at":null,"body":"Issue Type: Feature Idea\r\n\r\nAnsible Version: 2.0.0\r\n\r\nAnsible Configuration: not modified\r\n\r\nEnvironment: Ubuntu 14.04\r\n\r\nSummary: add last error to rescue block\r\n\r\nSteps To Reproduce:\r\nRescue block described at http://docs.ansible.com/ansible/playbooks_blocks.html have no way to retrieve last error.\r\nI think error notification will be frequent use case for blocks.\r\n\r\nSomething like this:\r\n```\r\ntasks:\r\n  - block:\r\n      - command: /bin/false\r\n    rescue:\r\n      - debug: var=ansible_last_error\r\n```\r\n\r\nExpected Results:\r\nLast error - playbook, task name, failure message.\r\n\r\nActual Results:\r\nNo variable defined"},"comment":{"url":"https://api.github.com/repos/ansible/ansible/issues/comments/140891675","html_url":"https://github.com/ansible/ansible/issues/12341#issuecomment-140891675","issue_url":"https://api.github.com/repos/ansible/ansible/issues/12341","id":140891675,"user":{"login":"jimi-c","id":26403,"avatar_url":"https://avatars.githubusercontent.com/u/26403?v=3","gravatar_id":"","url":"https://api.github.com/users/jimi-c","html_url":"https://github.com/jimi-c","followers_url":"https://api.github.com/users/jimi-c/followers","following_url":"https://api.github.com/users/jimi-c/following{/other_user}","gists_url":"https://api.github.com/users/jimi-c/gists{/gist_id}","starred_url":"https://api.github.com/users/jimi-c/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimi-c/subscriptions","organizations_url":"https://api.github.com/users/jimi-c/orgs","repos_url":"https://api.github.com/users/jimi-c/repos","events_url":"https://api.github.com/users/jimi-c/events{/privacy}","received_events_url":"https://api.github.com/users/jimi-c/received_events","type":"User","site_admin":false},"created_at":"2015-09-16T20:54:24Z","updated_at":"2015-09-16T20:54:24Z","body":"I was just mentioning to someone last night that this might be useful... not sure if we'll get it in by 2.0 but we'll keep this open.\r\n\r\nThanks!"}}