{"action":"created","comment":{"url":"https://api.github.com/repos/Shopify/liquid/pulls/comments/31228545","id":31228545,"diff_hunk":"@@ -68,9 +67,22 @@ def handle_error(e, token = nil)\n         e.set_line_number_from_token(token)\n       end\n \n+      output = nil\n+\n+      if exception_handler\n+        result = exception_handler.call(e)\n+        case result\n+        when Exception","path":"lib/liquid/context.rb","position":32,"original_position":32,"commit_id":"8d5e71f85633fa9c809080b42c873cd44a9f8eab","original_commit_id":"8d5e71f85633fa9c809080b42c873cd44a9f8eab","user":{"login":"fw42","id":2072686,"avatar_url":"https://avatars.githubusercontent.com/u/2072686?v=3","gravatar_id":"","url":"https://api.github.com/users/fw42","html_url":"https://github.com/fw42","followers_url":"https://api.github.com/users/fw42/followers","following_url":"https://api.github.com/users/fw42/following{/other_user}","gists_url":"https://api.github.com/users/fw42/gists{/gist_id}","starred_url":"https://api.github.com/users/fw42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fw42/subscriptions","organizations_url":"https://api.github.com/users/fw42/orgs","repos_url":"https://api.github.com/users/fw42/repos","events_url":"https://api.github.com/users/fw42/events{/privacy}","received_events_url":"https://api.github.com/users/fw42/received_events","type":"User","site_admin":false},"body":"oh sorry, that's not what's happening here. misread.","created_at":"2015-05-28T12:42:33Z","updated_at":"2015-05-28T12:42:33Z","html_url":"https://github.com/Shopify/liquid/pull/576#discussion_r31228545","pull_request_url":"https://api.github.com/repos/Shopify/liquid/pulls/576","_links":{"self":{"href":"https://api.github.com/repos/Shopify/liquid/pulls/comments/31228545"},"html":{"href":"https://github.com/Shopify/liquid/pull/576#discussion_r31228545"},"pull_request":{"href":"https://api.github.com/repos/Shopify/liquid/pulls/576"}}},"pull_request":{"url":"https://api.github.com/repos/Shopify/liquid/pulls/576","id":36358185,"html_url":"https://github.com/Shopify/liquid/pull/576","diff_url":"https://github.com/Shopify/liquid/pull/576.diff","patch_url":"https://github.com/Shopify/liquid/pull/576.patch","issue_url":"https://api.github.com/repos/Shopify/liquid/issues/576","number":576,"state":"open","locked":false,"title":"Allow the exception handler to convert exceptions to hide error messges","user":{"login":"dylanahsmith","id":954402,"avatar_url":"https://avatars.githubusercontent.com/u/954402?v=3","gravatar_id":"","url":"https://api.github.com/users/dylanahsmith","html_url":"https://github.com/dylanahsmith","followers_url":"https://api.github.com/users/dylanahsmith/followers","following_url":"https://api.github.com/users/dylanahsmith/following{/other_user}","gists_url":"https://api.github.com/users/dylanahsmith/gists{/gist_id}","starred_url":"https://api.github.com/users/dylanahsmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dylanahsmith/subscriptions","organizations_url":"https://api.github.com/users/dylanahsmith/orgs","repos_url":"https://api.github.com/users/dylanahsmith/repos","events_url":"https://api.github.com/users/dylanahsmith/events{/privacy}","received_events_url":"https://api.github.com/users/dylanahsmith/received_events","type":"User","site_admin":false},"body":"@fw42, @pushrax for review\r\ncc @arthurnn\r\n\r\n## Problem\r\n\r\nIt should be possible to control what is output for non-Liquid::Error exceptions, since these exceptions might expose internal details of the application.\r\n\r\n## Solution\r\n\r\nAllow the exception handler to return a string, which will be output for the error, or an exception that the original exception will be replaced with.\r\n\r\nhttps://github.com/Shopify/liquid/pull/573 made it possible to suppress the output of errors.  This can now be done with an exception handler that always returns `''`, so I removed that unreleased feature.\r\n\r\nI kept the old behaviour of allowing `true` to be returned to re-raise the exception, although this could have been implemented with an exception handler that just called `raise`.  I changed the internal usage of that within liquid for clarity.","created_at":"2015-05-27T23:10:27Z","updated_at":"2015-05-28T12:42:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0b996e4fb760ff7271f4f051c97f1a567c223b42","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Shopify/liquid/pulls/576/commits","review_comments_url":"https://api.github.com/repos/Shopify/liquid/pulls/576/comments","review_comment_url":"https://api.github.com/repos/Shopify/liquid/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Shopify/liquid/issues/576/comments","statuses_url":"https://api.github.com/repos/Shopify/liquid/statuses/8d5e71f85633fa9c809080b42c873cd44a9f8eab","head":{"label":"Shopify:flexible-exception-handler","ref":"flexible-exception-handler","sha":"8d5e71f85633fa9c809080b42c873cd44a9f8eab","user":{"login":"Shopify","id":8085,"avatar_url":"https://avatars.githubusercontent.com/u/8085?v=3","gravatar_id":"","url":"https://api.github.com/users/Shopify","html_url":"https://github.com/Shopify","followers_url":"https://api.github.com/users/Shopify/followers","following_url":"https://api.github.com/users/Shopify/following{/other_user}","gists_url":"https://api.github.com/users/Shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/Shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shopify/subscriptions","organizations_url":"https://api.github.com/users/Shopify/orgs","repos_url":"https://api.github.com/users/Shopify/repos","events_url":"https://api.github.com/users/Shopify/events{/privacy}","received_events_url":"https://api.github.com/users/Shopify/received_events","type":"Organization","site_admin":false},"repo":{"id":15435,"name":"liquid","full_name":"Shopify/liquid","owner":{"login":"Shopify","id":8085,"avatar_url":"https://avatars.githubusercontent.com/u/8085?v=3","gravatar_id":"","url":"https://api.github.com/users/Shopify","html_url":"https://github.com/Shopify","followers_url":"https://api.github.com/users/Shopify/followers","following_url":"https://api.github.com/users/Shopify/following{/other_user}","gists_url":"https://api.github.com/users/Shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/Shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shopify/subscriptions","organizations_url":"https://api.github.com/users/Shopify/orgs","repos_url":"https://api.github.com/users/Shopify/repos","events_url":"https://api.github.com/users/Shopify/events{/privacy}","received_events_url":"https://api.github.com/users/Shopify/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Shopify/liquid","description":"Liquid markup language. Safe, customer facing template language for flexible web apps. ","fork":false,"url":"https://api.github.com/repos/Shopify/liquid","forks_url":"https://api.github.com/repos/Shopify/liquid/forks","keys_url":"https://api.github.com/repos/Shopify/liquid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Shopify/liquid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Shopify/liquid/teams","hooks_url":"https://api.github.com/repos/Shopify/liquid/hooks","issue_events_url":"https://api.github.com/repos/Shopify/liquid/issues/events{/number}","events_url":"https://api.github.com/repos/Shopify/liquid/events","assignees_url":"https://api.github.com/repos/Shopify/liquid/assignees{/user}","branches_url":"https://api.github.com/repos/Shopify/liquid/branches{/branch}","tags_url":"https://api.github.com/repos/Shopify/liquid/tags","blobs_url":"https://api.github.com/repos/Shopify/liquid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Shopify/liquid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Shopify/liquid/git/refs{/sha}","trees_url":"https://api.github.com/repos/Shopify/liquid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Shopify/liquid/statuses/{sha}","languages_url":"https://api.github.com/repos/Shopify/liquid/languages","stargazers_url":"https://api.github.com/repos/Shopify/liquid/stargazers","contributors_url":"https://api.github.com/repos/Shopify/liquid/contributors","subscribers_url":"https://api.github.com/repos/Shopify/liquid/subscribers","subscription_url":"https://api.github.com/repos/Shopify/liquid/subscription","commits_url":"https://api.github.com/repos/Shopify/liquid/commits{/sha}","git_commits_url":"https://api.github.com/repos/Shopify/liquid/git/commits{/sha}","comments_url":"https://api.github.com/repos/Shopify/liquid/comments{/number}","issue_comment_url":"https://api.github.com/repos/Shopify/liquid/issues/comments{/number}","contents_url":"https://api.github.com/repos/Shopify/liquid/contents/{+path}","compare_url":"https://api.github.com/repos/Shopify/liquid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Shopify/liquid/merges","archive_url":"https://api.github.com/repos/Shopify/liquid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Shopify/liquid/downloads","issues_url":"https://api.github.com/repos/Shopify/liquid/issues{/number}","pulls_url":"https://api.github.com/repos/Shopify/liquid/pulls{/number}","milestones_url":"https://api.github.com/repos/Shopify/liquid/milestones{/number}","notifications_url":"https://api.github.com/repos/Shopify/liquid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Shopify/liquid/labels{/name}","releases_url":"https://api.github.com/repos/Shopify/liquid/releases{/id}","created_at":"2008-05-08T15:27:26Z","updated_at":"2015-05-28T11:46:42Z","pushed_at":"2015-05-27T23:10:27Z","git_url":"git://github.com/Shopify/liquid.git","ssh_url":"git@github.com:Shopify/liquid.git","clone_url":"https://github.com/Shopify/liquid.git","svn_url":"https://github.com/Shopify/liquid","homepage":"http://liquidmarkup.org/","size":8261,"stargazers_count":3355,"watchers_count":3355,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":448,"mirror_url":null,"open_issues_count":42,"forks":448,"open_issues":42,"watchers":3355,"default_branch":"master"}},"base":{"label":"Shopify:master","ref":"master","sha":"89c6e605f861578a7e6a634dfc9dce60bf599a49","user":{"login":"Shopify","id":8085,"avatar_url":"https://avatars.githubusercontent.com/u/8085?v=3","gravatar_id":"","url":"https://api.github.com/users/Shopify","html_url":"https://github.com/Shopify","followers_url":"https://api.github.com/users/Shopify/followers","following_url":"https://api.github.com/users/Shopify/following{/other_user}","gists_url":"https://api.github.com/users/Shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/Shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shopify/subscriptions","organizations_url":"https://api.github.com/users/Shopify/orgs","repos_url":"https://api.github.com/users/Shopify/repos","events_url":"https://api.github.com/users/Shopify/events{/privacy}","received_events_url":"https://api.github.com/users/Shopify/received_events","type":"Organization","site_admin":false},"repo":{"id":15435,"name":"liquid","full_name":"Shopify/liquid","owner":{"login":"Shopify","id":8085,"avatar_url":"https://avatars.githubusercontent.com/u/8085?v=3","gravatar_id":"","url":"https://api.github.com/users/Shopify","html_url":"https://github.com/Shopify","followers_url":"https://api.github.com/users/Shopify/followers","following_url":"https://api.github.com/users/Shopify/following{/other_user}","gists_url":"https://api.github.com/users/Shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/Shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shopify/subscriptions","organizations_url":"https://api.github.com/users/Shopify/orgs","repos_url":"https://api.github.com/users/Shopify/repos","events_url":"https://api.github.com/users/Shopify/events{/privacy}","received_events_url":"https://api.github.com/users/Shopify/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Shopify/liquid","description":"Liquid markup language. Safe, customer facing template language for flexible web apps. ","fork":false,"url":"https://api.github.com/repos/Shopify/liquid","forks_url":"https://api.github.com/repos/Shopify/liquid/forks","keys_url":"https://api.github.com/repos/Shopify/liquid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Shopify/liquid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Shopify/liquid/teams","hooks_url":"https://api.github.com/repos/Shopify/liquid/hooks","issue_events_url":"https://api.github.com/repos/Shopify/liquid/issues/events{/number}","events_url":"https://api.github.com/repos/Shopify/liquid/events","assignees_url":"https://api.github.com/repos/Shopify/liquid/assignees{/user}","branches_url":"https://api.github.com/repos/Shopify/liquid/branches{/branch}","tags_url":"https://api.github.com/repos/Shopify/liquid/tags","blobs_url":"https://api.github.com/repos/Shopify/liquid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Shopify/liquid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Shopify/liquid/git/refs{/sha}","trees_url":"https://api.github.com/repos/Shopify/liquid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Shopify/liquid/statuses/{sha}","languages_url":"https://api.github.com/repos/Shopify/liquid/languages","stargazers_url":"https://api.github.com/repos/Shopify/liquid/stargazers","contributors_url":"https://api.github.com/repos/Shopify/liquid/contributors","subscribers_url":"https://api.github.com/repos/Shopify/liquid/subscribers","subscription_url":"https://api.github.com/repos/Shopify/liquid/subscription","commits_url":"https://api.github.com/repos/Shopify/liquid/commits{/sha}","git_commits_url":"https://api.github.com/repos/Shopify/liquid/git/commits{/sha}","comments_url":"https://api.github.com/repos/Shopify/liquid/comments{/number}","issue_comment_url":"https://api.github.com/repos/Shopify/liquid/issues/comments{/number}","contents_url":"https://api.github.com/repos/Shopify/liquid/contents/{+path}","compare_url":"https://api.github.com/repos/Shopify/liquid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Shopify/liquid/merges","archive_url":"https://api.github.com/repos/Shopify/liquid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Shopify/liquid/downloads","issues_url":"https://api.github.com/repos/Shopify/liquid/issues{/number}","pulls_url":"https://api.github.com/repos/Shopify/liquid/pulls{/number}","milestones_url":"https://api.github.com/repos/Shopify/liquid/milestones{/number}","notifications_url":"https://api.github.com/repos/Shopify/liquid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Shopify/liquid/labels{/name}","releases_url":"https://api.github.com/repos/Shopify/liquid/releases{/id}","created_at":"2008-05-08T15:27:26Z","updated_at":"2015-05-28T11:46:42Z","pushed_at":"2015-05-27T23:10:27Z","git_url":"git://github.com/Shopify/liquid.git","ssh_url":"git@github.com:Shopify/liquid.git","clone_url":"https://github.com/Shopify/liquid.git","svn_url":"https://github.com/Shopify/liquid","homepage":"http://liquidmarkup.org/","size":8261,"stargazers_count":3355,"watchers_count":3355,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":448,"mirror_url":null,"open_issues_count":42,"forks":448,"open_issues":42,"watchers":3355,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Shopify/liquid/pulls/576"},"html":{"href":"https://github.com/Shopify/liquid/pull/576"},"issue":{"href":"https://api.github.com/repos/Shopify/liquid/issues/576"},"comments":{"href":"https://api.github.com/repos/Shopify/liquid/issues/576/comments"},"review_comments":{"href":"https://api.github.com/repos/Shopify/liquid/pulls/576/comments"},"review_comment":{"href":"https://api.github.com/repos/Shopify/liquid/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Shopify/liquid/pulls/576/commits"},"statuses":{"href":"https://api.github.com/repos/Shopify/liquid/statuses/8d5e71f85633fa9c809080b42c873cd44a9f8eab"}}}}