{"action":"created","issue":{"url":"https://api.github.com/repos/tmm1/pygments.rb/issues/69","repository_url":"https://api.github.com/repos/tmm1/pygments.rb","labels_url":"https://api.github.com/repos/tmm1/pygments.rb/issues/69/labels{/name}","comments_url":"https://api.github.com/repos/tmm1/pygments.rb/issues/69/comments","events_url":"https://api.github.com/repos/tmm1/pygments.rb/issues/69/events","html_url":"https://github.com/tmm1/pygments.rb/issues/69","id":12615235,"number":69,"title":"Should pygments.rb handle lexer not found errors differently?","user":{"login":"n8","id":14879,"avatar_url":"https://avatars.githubusercontent.com/u/14879?v=3","gravatar_id":"","url":"https://api.github.com/users/n8","html_url":"https://github.com/n8","followers_url":"https://api.github.com/users/n8/followers","following_url":"https://api.github.com/users/n8/following{/other_user}","gists_url":"https://api.github.com/users/n8/gists{/gist_id}","starred_url":"https://api.github.com/users/n8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/n8/subscriptions","organizations_url":"https://api.github.com/users/n8/orgs","repos_url":"https://api.github.com/users/n8/repos","events_url":"https://api.github.com/users/n8/events{/privacy}","received_events_url":"https://api.github.com/users/n8/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2013-03-29T19:02:58Z","updated_at":"2016-08-22T23:24:15Z","closed_at":"2013-07-27T23:55:34Z","body":"Pygments is awesome, but I've noticed that as soon as I implemented this people trying to use backticks with lexers that don't exist or accidentally using backticks without any intention of adding a code block now get errors from mentos.rb about that lexer not being found. \r\n\r\n```\r\nget_lexer_by_name raise ClassNotFound('no lexer for alias %r found' % _alias) ClassNotFound: no lexer for alias 'Go' found\r\n```\r\n\r\nI was curious from your perspective, if it should be pygments.rb's responsibility to catch the class not found exception and just return the code block with some vanilla/default formatting instead of raising this exception up. \r\n\r\nOr should this be an exception dealt with higher up the stack?"},"comment":{"url":"https://api.github.com/repos/tmm1/pygments.rb/issues/comments/241581420","html_url":"https://github.com/tmm1/pygments.rb/issues/69#issuecomment-241581420","issue_url":"https://api.github.com/repos/tmm1/pygments.rb/issues/69","id":241581420,"user":{"login":"ian-kelling","id":54232,"avatar_url":"https://avatars.githubusercontent.com/u/54232?v=3","gravatar_id":"","url":"https://api.github.com/users/ian-kelling","html_url":"https://github.com/ian-kelling","followers_url":"https://api.github.com/users/ian-kelling/followers","following_url":"https://api.github.com/users/ian-kelling/following{/other_user}","gists_url":"https://api.github.com/users/ian-kelling/gists{/gist_id}","starred_url":"https://api.github.com/users/ian-kelling/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ian-kelling/subscriptions","organizations_url":"https://api.github.com/users/ian-kelling/orgs","repos_url":"https://api.github.com/users/ian-kelling/repos","events_url":"https://api.github.com/users/ian-kelling/events{/privacy}","received_events_url":"https://api.github.com/users/ian-kelling/received_events","type":"User","site_admin":false},"created_at":"2016-08-22T23:24:15Z","updated_at":"2016-08-22T23:24:15Z","body":"> You should verify the lexer exists before trying to use it. See linguist for examples.\r\n\r\nJust fyi: linguist doesn't use pygments.rb directly. Perhaps some dependency does. I hit this error and was wondering the proper way to deal with it, after a bunch of reading docs and messing with pygments,\r\n\r\n\r\n`    begin\r\n      Pygments.highlight(code, lexer: language)\r\n    rescue MentosError => e\r\n      Pygments.highlight(code, lexer: 'text')\r\n    end\r\n`"}}
{"actor":{"display_login":"ian-kelling"}}