{"action":"created","issue":{"url":"https://api.github.com/repos/eslint/eslint/issues/5483","repository_url":"https://api.github.com/repos/eslint/eslint","labels_url":"https://api.github.com/repos/eslint/eslint/issues/5483/labels{/name}","comments_url":"https://api.github.com/repos/eslint/eslint/issues/5483/comments","events_url":"https://api.github.com/repos/eslint/eslint/issues/5483/events","html_url":"https://github.com/eslint/eslint/pull/5483","id":138738022,"number":5483,"title":"New: Exception message template for uncaught rule error (refs #5221)","user":{"login":"platinumazure","id":284282,"avatar_url":"https://avatars.githubusercontent.com/u/284282?v=3","gravatar_id":"","url":"https://api.github.com/users/platinumazure","html_url":"https://github.com/platinumazure","followers_url":"https://api.github.com/users/platinumazure/followers","following_url":"https://api.github.com/users/platinumazure/following{/other_user}","gists_url":"https://api.github.com/users/platinumazure/gists{/gist_id}","starred_url":"https://api.github.com/users/platinumazure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/platinumazure/subscriptions","organizations_url":"https://api.github.com/users/platinumazure/orgs","repos_url":"https://api.github.com/users/platinumazure/repos","events_url":"https://api.github.com/users/platinumazure/events{/privacy}","received_events_url":"https://api.github.com/users/platinumazure/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/eslint/eslint/labels/cla%20found","name":"cla found","color":"009800"},{"url":"https://api.github.com/repos/eslint/eslint/labels/do%20not%20merge","name":"do not merge","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-03-06T00:28:50Z","updated_at":"2016-03-07T15:32:42Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/eslint/eslint/pulls/5483","html_url":"https://github.com/eslint/eslint/pull/5483","diff_url":"https://github.com/eslint/eslint/pull/5483.diff","patch_url":"https://github.com/eslint/eslint/pull/5483.patch"},"body":"Hi folks. I'm asking for 30% feedback here (meaning this PR is probably not ready to merge yet). Please take a look and let me know if this is the right direction.\r\n\r\nTerminology:\r\n\r\n* Rule action: That is my name for the node event handler in rules, i.e., the values returned in the rule creator function.\r\n\r\nThe highlights:\r\n\r\n* When lib/eslint.js calls `api.on(nodeType)`, I am wrapping the rule action function in a containing function which will call the rule action with try/catch, and if an exception is thrown, it will decorate the exception with metadata representing a new message template.\r\n* New message template contains information on how to report the bug. Probably needs some polishing and copy-editing.\r\n\r\nStill to do:\r\n\r\n1. Get the filename into the message.\r\n1. Find a way to determine which parser is being used, so we can differentiate the message for people who aren't using espree. (Or we can save that for a near-future PR.)\r\n1. Report on node metadata (e.g., line and column number).\r\n1. Crazy thought: Get the RuleContext object into the wrapper, so that we can do `context.getSourceCode().getText(node)`?\r\n\r\nFeedback welcome!"},"comment":{"url":"https://api.github.com/repos/eslint/eslint/issues/comments/193300703","html_url":"https://github.com/eslint/eslint/pull/5483#issuecomment-193300703","issue_url":"https://api.github.com/repos/eslint/eslint/issues/5483","id":193300703,"user":{"login":"ilyavolodin","id":1380062,"avatar_url":"https://avatars.githubusercontent.com/u/1380062?v=3","gravatar_id":"","url":"https://api.github.com/users/ilyavolodin","html_url":"https://github.com/ilyavolodin","followers_url":"https://api.github.com/users/ilyavolodin/followers","following_url":"https://api.github.com/users/ilyavolodin/following{/other_user}","gists_url":"https://api.github.com/users/ilyavolodin/gists{/gist_id}","starred_url":"https://api.github.com/users/ilyavolodin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilyavolodin/subscriptions","organizations_url":"https://api.github.com/users/ilyavolodin/orgs","repos_url":"https://api.github.com/users/ilyavolodin/repos","events_url":"https://api.github.com/users/ilyavolodin/events{/privacy}","received_events_url":"https://api.github.com/users/ilyavolodin/received_events","type":"User","site_admin":false},"created_at":"2016-03-07T15:32:42Z","updated_at":"2016-03-07T15:32:42Z","body":"Actually just checked. `parserName` should also be available on `ruleContext`. It was added in #4649"}}