{"action":"opened","issue":{"url":"https://api.github.com/repos/rails/rails/issues/26813","repository_url":"https://api.github.com/repos/rails/rails","labels_url":"https://api.github.com/repos/rails/rails/issues/26813/labels{/name}","comments_url":"https://api.github.com/repos/rails/rails/issues/26813/comments","events_url":"https://api.github.com/repos/rails/rails/issues/26813/events","html_url":"https://github.com/rails/rails/issues/26813","id":183677669,"number":26813,"title":"XmlMini_REXML throws potentially undefined errors.","user":{"login":"yxhuvud","id":155895,"avatar_url":"https://avatars.githubusercontent.com/u/155895?v=3","gravatar_id":"","url":"https://api.github.com/users/yxhuvud","html_url":"https://github.com/yxhuvud","followers_url":"https://api.github.com/users/yxhuvud/followers","following_url":"https://api.github.com/users/yxhuvud/following{/other_user}","gists_url":"https://api.github.com/users/yxhuvud/gists{/gist_id}","starred_url":"https://api.github.com/users/yxhuvud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yxhuvud/subscriptions","organizations_url":"https://api.github.com/users/yxhuvud/orgs","repos_url":"https://api.github.com/users/yxhuvud/repos","events_url":"https://api.github.com/users/yxhuvud/events{/privacy}","received_events_url":"https://api.github.com/users/yxhuvud/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-18T12:52:43Z","updated_at":"2016-10-18T12:52:43Z","closed_at":null,"body":"### Steps to reproduce\r\n\r\nAssume a function looking roughly like this:\r\n\r\n```ruby\r\ndef read_and_process\r\n      Hash.from_xml do_something\r\nrescue REXML::ParseException\r\nend\r\n```\r\n\r\nfrom_xml may raise REXML::ParseException, but if do_something also raise an exception, then REXML::ParseException may be undefined, depending on if something (potentially a successful earlier run) has managed to require rexml/document or not. \r\n\r\n### Expected behavior\r\n\r\nI would expect to have all exceptions defined before the method is called the first time, so that it is possible to catch the exception. \r\n\r\n### Workaround\r\nThis can be worked around by manually requiring rexml/document.\r\n\r\n### Suggested resolution: \r\nEither make certain REXML::ParseException is defined or raise some other exception that is defined. \r\n\r\n### System configuration\r\n**Rails version**: 4.2.6\r\n\r\n**Ruby version**: 2.3.1\r\n"}}
{"actor":{"display_login":"yxhuvud"}}