-
Notifications
You must be signed in to change notification settings - Fork 8
Usage Example
MJ Rossetti edited this page Sep 7, 2016
·
1 revision
require "honeybadger-api"
Honeybadger::Api.configure do |c|
c.access_token = ENV.fetch("HONEYBADGER_PRODUCTION_AUTH_TOKEN", "Please specify a honeybadger authentication token.")
end
project = Honeybadger::Api::Project.all.first
paginator = Honeybadger::Api::Fault.paginate(project.id)
pages = paginator.pages.values
pages.each do |page|
while page.any?
page.each do |fault|
item = {
:action => fault.action,
:component => fault.component,
:created_at => fault.created_at,
:id => fault.id,
:error_class => fault.klass,
:error_message => fault.message,
:notices_count => fault.notices_count
}
puts "#{item[:id]} -- #{item[:created_at].strftime('%Y-%m-%d')} -- #{item[:error_class]}"
end
page = paginator.next? ? paginator.next : []
end
end