Custom 500/Application Errors

Hi, I’m working on creating custom 500 errors in rails 2.1. Specifically
I’m trying to send an email with the exception every time an application
error occurs.

So I follow these instructions:

http://wiki.rubyonrails.org/rails/pages/HandlingPreControllerErrors

It tells me to put an error handler in /lib/ then require it in
environment.rb.

HOWEVER, when I past it’s code, creating something called an
“ActionController”, I can no longer start mongrel. Because of
“uninitialized constant ActionController”

Whats the deal?

Please help!

Thank you

On Mon, Aug 25, 2008 at 12:34 PM, Alex Williams
[email protected] wrote:

environment.rb.

HOWEVER, when I past it’s code, creating something called an
“ActionController”, I can no longer start mongrel. Because of
“uninitialized constant ActionController”

Whats the deal?

Please help!

Alex,

There are a few options for this. The typical solution is to use the
Exception Notification plugin.

This plugin will let you define email recipients to direct
exceptions/errors to. You can take a look at the README for
instructions on installing and configuring.

Additionally, there are also a few web services that provide APIs that
you can direct exceptions to. I’ve been a beta tester for Exceptional,
which our team is using across five client projects in production
right now with great success. You might look at this as a solution
once they open it up to more customers.

Another new comer to this arena is Hoptoad, which I haven’t had a
chance to play with yet.

Good luck!

Cheers,
Robby


Robby R.
Chief Evangelist, Partner

PLANET ARGON, LLC
design // development // hosting


http://www.robbyonrails.com/
aim: planetargon

+1 503 445 2457
+1 877 55 ARGON [toll free]
+1 815 642 4068 [fax]

Robby R. wrote:

On Mon, Aug 25, 2008 at 12:34 PM, Alex Williams
[email protected] wrote:

environment.rb.

HOWEVER, when I past it’s code, creating something called an
“ActionController”, I can no longer start mongrel. Because of
“uninitialized constant ActionController”

Whats the deal?

Please help!

Alex,

There are a few options for this. The typical solution is to use the
Exception Notification plugin.

This plugin will let you define email recipients to direct
exceptions/errors to. You can take a look at the README for
instructions on installing and configuring.

Additionally, there are also a few web services that provide APIs that
you can direct exceptions to. I’ve been a beta tester for Exceptional,
which our team is using across five client projects in production
right now with great success. You might look at this as a solution
once they open it up to more customers.

Another new comer to this arena is Hoptoad, which I haven’t had a
chance to play with yet.

Good luck!

Cheers,
Robby


Robby R.
Chief Evangelist, Partner

PLANET ARGON, LLC
design // development // hosting

http://www.planetargon.com/
http://www.robbyonrails.com/
aim: planetargon

+1 503 445 2457
+1 877 55 ARGON [toll free]
+1 815 642 4068 [fax]

Thank you for the Fast response. I am trying to install
exception_notifier. Now it isn’t working, but I have a feeling it’s
something simple I just don’t know about.

I downloaded exception_notifier and put it in my plugins folder like the
reset of 'em are. I pasted the line:

include ExceptionNotifiable

in my application folder as asked.

then I added this to environment.rb:

ExceptionNotifier.exception_recipients = %w([email protected]
[email protected])

Essentially I was just testing defaults. However, I receive the error
“uninitialized constant ExceptionNotifier”

So what do I need to do to get ExceptionNotifier working? It may be
something I simply don’t understand about installing plugins this way.

Thank you I hope hear from you.

Robby R. wrote:

On Mon, Aug 25, 2008 at 2:05 PM, Alex Williams
[email protected] wrote:

Robby
http://www.planetargon.com/

I downloaded exception_notifier and put it in my plugins folder like the
reset of 'em are. I pasted the line:

include ExceptionNotifiable

in my application folder as asked.

Just to clarify… you meant application controller?

Essentially I was just testing defaults. However, I receive the error
“uninitialized constant ExceptionNotifier”

Hmm, I don’t think that you need to require this in your
environment.rb. It might not be initializing the plugin.

Robby


Robby R.
Chief Evangelist, Partner

PLANET ARGON, LLC
design // development // hosting

http://www.planetargon.com/
http://www.robbyonrails.com/
aim: planetargon

+1 503 445 2457
+1 877 55 ARGON [toll free]
+1 815 642 4068 [fax]

Yes application controller, sorry :slight_smile:

I’m follow the instructions from the website you posted. Here they are:


First, include the ExceptionNotifiable mixin in whichever controller you
want
to generate error emails (typically ApplicationController):

class ApplicationController < ActionController::Base
include ExceptionNotifiable

end

Then, specify the email recipients in your environment:

ExceptionNotifier.exception_recipients = %w([email protected]
[email protected])

And that’s it! The defaults take care of the rest.

But again it isn’t initializing “ExceptionNotifier”, so what should I
do?

I put the download right into the plugins folder so it looks like:

/plugins/exception_notfier/
lib
test
views
INIT.rb
README

On Mon, Aug 25, 2008 at 2:05 PM, Alex Williams
[email protected] wrote:

Robby
http://www.planetargon.com/

I downloaded exception_notifier and put it in my plugins folder like the
reset of 'em are. I pasted the line:

include ExceptionNotifiable

in my application folder as asked.

Just to clarify… you meant application controller?

Essentially I was just testing defaults. However, I receive the error
“uninitialized constant ExceptionNotifier”

Hmm, I don’t think that you need to require this in your
environment.rb. It might not be initializing the plugin.

Robby


Robby R.
Chief Evangelist, Partner

PLANET ARGON, LLC
design // development // hosting


http://www.robbyonrails.com/
aim: planetargon

+1 503 445 2457
+1 877 55 ARGON [toll free]
+1 815 642 4068 [fax]

For anyone who happens across this searching for an answer (as I was)
the solution is to restart the server. Seemed to do the trick in my
case.

Any ideas Robby?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs