{"action":"created","issue":{"url":"https://api.github.com/repos/mixpanel/mixpanel-ruby/issues/85","labels_url":"https://api.github.com/repos/mixpanel/mixpanel-ruby/issues/85/labels{/name}","comments_url":"https://api.github.com/repos/mixpanel/mixpanel-ruby/issues/85/comments","events_url":"https://api.github.com/repos/mixpanel/mixpanel-ruby/issues/85/events","html_url":"https://github.com/mixpanel/mixpanel-ruby/pull/85","id":90256156,"number":85,"title":"Minor mixpanel error handler","user":{"login":"zyskowsk","id":3455047,"avatar_url":"https://avatars.githubusercontent.com/u/3455047?v=3","gravatar_id":"","url":"https://api.github.com/users/zyskowsk","html_url":"https://github.com/zyskowsk","followers_url":"https://api.github.com/users/zyskowsk/followers","following_url":"https://api.github.com/users/zyskowsk/following{/other_user}","gists_url":"https://api.github.com/users/zyskowsk/gists{/gist_id}","starred_url":"https://api.github.com/users/zyskowsk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zyskowsk/subscriptions","organizations_url":"https://api.github.com/users/zyskowsk/orgs","repos_url":"https://api.github.com/users/zyskowsk/repos","events_url":"https://api.github.com/users/zyskowsk/events{/privacy}","received_events_url":"https://api.github.com/users/zyskowsk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-06-23T01:15:16Z","updated_at":"2015-06-24T21:52:43Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mixpanel/mixpanel-ruby/pulls/85","html_url":"https://github.com/mixpanel/mixpanel-ruby/pull/85","diff_url":"https://github.com/mixpanel/mixpanel-ruby/pull/85.diff","patch_url":"https://github.com/mixpanel/mixpanel-ruby/pull/85.patch"},"body":"Standardize an api for custom error handlers.  Inspired by @EtienneDepaulis in #82.  The api is as follows.  To create a custom error handler, extend `Mixpanel::ErrorHandler` and pass an instance of this custom class to `Mixpanel::Tracker` on initialization.  For example:\r\n\r\n```ruby\r\nrequire 'logger'\r\n\r\nclass MyErrorHandler < Mixpanel::ErrorHandler\r\n\r\n  def initialize\r\n    @logger = Logger.new('mylogfile.log')\r\n    @logger.level = Logger::ERROR\r\n  end\r\n    \r\n  def handle(error)\r\n    logger.error \"#{error.inspect}\\n Backtrace: #{error.backtrace}\"\r\n  end\r\nend\r\n\r\nmy_error_handler = MyErrorHandler.new\r\ntracker = Mixpanel::Tracker.new(YOUR_MIXPANEL_TOKEN, my_error_handler)\r\n```"},"comment":{"url":"https://api.github.com/repos/mixpanel/mixpanel-ruby/issues/comments/115022255","html_url":"https://github.com/mixpanel/mixpanel-ruby/pull/85#issuecomment-115022255","issue_url":"https://api.github.com/repos/mixpanel/mixpanel-ruby/issues/85","id":115022255,"user":{"login":"zyskowsk","id":3455047,"avatar_url":"https://avatars.githubusercontent.com/u/3455047?v=3","gravatar_id":"","url":"https://api.github.com/users/zyskowsk","html_url":"https://github.com/zyskowsk","followers_url":"https://api.github.com/users/zyskowsk/followers","following_url":"https://api.github.com/users/zyskowsk/following{/other_user}","gists_url":"https://api.github.com/users/zyskowsk/gists{/gist_id}","starred_url":"https://api.github.com/users/zyskowsk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zyskowsk/subscriptions","organizations_url":"https://api.github.com/users/zyskowsk/orgs","repos_url":"https://api.github.com/users/zyskowsk/repos","events_url":"https://api.github.com/users/zyskowsk/events{/privacy}","received_events_url":"https://api.github.com/users/zyskowsk/received_events","type":"User","site_admin":false},"created_at":"2015-06-24T21:52:43Z","updated_at":"2015-06-24T21:52:43Z","body":"Indeed! => 6275709c93eb653f5ff9278b3ba48c87537f0795"}}