MeExceptional

The Gem notifies you of application exceptions by email and adds some useful information about the request and the client issuing the request. It is heavily inspired by the exceptional gem and takes some of it design for the HTML email.

Installation

Install the gem in your Rails 3 App as usual:

gem install me_exceptional

After you have installed MeExceptional and added it to your Gemfile, run the generator.

rails generate me_exceptional:install

The generator will create an initializer which you MUST take a look at and configure.

NOTE: Support for Rails 2.x is not provided so far.

Getting Started

Being an engine MeExceptional has mailer and views already set up for you to get started; if your app raises an exception production mode you will get notified by email (note: doesn’t work for routing errors so far because of a bug in rails). You may, however change view and mailer to suit you better.

Configuring views

If you want to change the email, you just need to invoke the generator that copies it over to your application:

rails generate me_exceptional:views

This copies the mailer views to “/app/views/me_exceptional”.

Configuring mailer

In case you also want to customize the mailer, invoke the mailer generator:

rails generate me_exceptional:mailer

This creates the directory “/app/mailers/me_exceptional” with the mailer contained.

Usage outside of ActionController

To use MeExceptional outside ActionController, i.e. in delayed jobs, you must include the BasicExtension and specifiy the methods you want to catch exceptions from in the class definition.

class Dummy
   include MeExceptional::BasicExtension

   def some_error
     raise "some error"
   end

   def another_error
     raise "some error"
   end

    rescue_mail_from_methods :some_error, :another_error
 end

Remember to put the call to rescue_mail_from_methods after the method definitions because the methods will be aliased.

Outlook

  • more gem side configuration options

  • asynchronous mailing options

  • routing errors and other errors