{"action":"created","issue":{"url":"https://api.github.com/repos/local-ch/lhc/issues/59","repository_url":"https://api.github.com/repos/local-ch/lhc","labels_url":"https://api.github.com/repos/local-ch/lhc/issues/59/labels{/name}","comments_url":"https://api.github.com/repos/local-ch/lhc/issues/59/comments","events_url":"https://api.github.com/repos/local-ch/lhc/issues/59/events","html_url":"https://github.com/local-ch/lhc/pull/59","id":173150696,"number":59,"title":"Request error handlers","user":{"login":"pape-io","id":851393,"avatar_url":"https://avatars.githubusercontent.com/u/851393?v=3","gravatar_id":"","url":"https://api.github.com/users/pape-io","html_url":"https://github.com/pape-io","followers_url":"https://api.github.com/users/pape-io/followers","following_url":"https://api.github.com/users/pape-io/following{/other_user}","gists_url":"https://api.github.com/users/pape-io/gists{/gist_id}","starred_url":"https://api.github.com/users/pape-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pape-io/subscriptions","organizations_url":"https://api.github.com/users/pape-io/orgs","repos_url":"https://api.github.com/users/pape-io/repos","events_url":"https://api.github.com/users/pape-io/events{/privacy}","received_events_url":"https://api.github.com/users/pape-io/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-08-25T09:07:59Z","updated_at":"2016-08-25T10:47:19Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/local-ch/lhc/pulls/59","html_url":"https://github.com/local-ch/lhc/pull/59","diff_url":"https://github.com/local-ch/lhc/pull/59.diff","patch_url":"https://github.com/local-ch/lhc/pull/59.patch"},"body":"You can provide custom error handlers to handle errors happening during the request.\r\n\r\nIf a error handler is provided nothing is raised.\r\n\r\nIf your error handler returns anything else but `nil` it replaces the response body.\r\n\r\n```ruby\r\nhandler = ->{ do_something; return {name: 'unknown'} }\r\nresponse = LHC.get('http://something', error_handler: handler)\r\nresponse.data.name # 'unknown'\r\n```\r\n---------\r\n\r\n- Required for some LHS feature to chain error handling and inject data in case of errors\r\n- Minor version increase ahead"},"comment":{"url":"https://api.github.com/repos/local-ch/lhc/issues/comments/242347092","html_url":"https://github.com/local-ch/lhc/pull/59#issuecomment-242347092","issue_url":"https://api.github.com/repos/local-ch/lhc/issues/59","id":242347092,"user":{"login":"gonzalocasas","id":933277,"avatar_url":"https://avatars.githubusercontent.com/u/933277?v=3","gravatar_id":"","url":"https://api.github.com/users/gonzalocasas","html_url":"https://github.com/gonzalocasas","followers_url":"https://api.github.com/users/gonzalocasas/followers","following_url":"https://api.github.com/users/gonzalocasas/following{/other_user}","gists_url":"https://api.github.com/users/gonzalocasas/gists{/gist_id}","starred_url":"https://api.github.com/users/gonzalocasas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gonzalocasas/subscriptions","organizations_url":"https://api.github.com/users/gonzalocasas/orgs","repos_url":"https://api.github.com/users/gonzalocasas/repos","events_url":"https://api.github.com/users/gonzalocasas/events{/privacy}","received_events_url":"https://api.github.com/users/gonzalocasas/received_events","type":"User","site_admin":false},"created_at":"2016-08-25T10:47:19Z","updated_at":"2016-08-25T10:47:19Z","body":"Can't this be achieved more generally with interceptors instead of having explicit support for a specific kind of interception (i.e. error handling)? "}}
{"actor":{"display_login":"gonzalocasas"}}