Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
lib
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Gem Version Maintainability

Exceptiontrap

This gem is used to catch and report your Ruby on Rails applications errors and exceptions to the Exceptiontrap webservice.

The gem is compatible with Rails 3, 4, 5, and 6

Setup

1. Install

Install the Exceptiontrap gem by putting this line to your Gemfile

gem 'exceptiontrap'

then run bundle

2. Configure

Now generate the config/exceptiontrap.yml file with

rails generate exceptiontrap --api-key YOUR_API_KEY

and you should be fine.

Note: Some exceptions are ignored by default, e.g. RoutingError and RecordNotFound errors. You can change this behavior in the config/exceptiontrap.yml file that we just generated.

Information / Further Configuration

You can find your API-Key by logging in to your Exceptiontrap Account. Select the application, and follow the Setup link.

Integration with Background Jobs and Workers

Sidekiq

Exceptiontrap catches Sidekiq errors automatically. You don't have to set up anything. Easy, right?

DelayedJob

There is no automatic integration into DelayedJob yet. Meanwhile you can let Exceptiontrap notifiy you about errors using its notify method inside DelayedJob's error hook.

class ParanoidNewsletterJob < NewsletterJob
  # ...

  def error(job, exception)
    Exceptiontrap.notify(exception, custom_controller: job.class.name)
  end
end

Resque

There is no automatic integration into Resque yet. Meanwhile you can let Exceptiontrap notifiy you about errors using its notify method inside Resque's on_failure hook.

You can also create a module with Exceptiontrap enabled and integrate it.

module ExceptiontrapJob
  def on_failure(exception, *args)
    Exceptiontrap.notify(exception, args)
  end
end

class MyJob
  extend ExceptiontrapJob
  def self.perform(*args)
    ...
  end
end

Known Issues / Todo

Optimize and add the test suite.

Copyright (c) 2019 [Torsten Bühl], released under the MIT license

About

Exceptiontrap – Exception Catcher / Tracker & Notifier Gem for Ruby on Rails

Resources

License

Packages

No packages published

Languages