bjhess
unread,May 6, 2011, 4:29:32 PM5/6/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Hoptoad Notifier Dev
We've run up against a nasty set of behaviors today with
hoptoad_notifier and Rails3. By default it ignores routing errors:
ActionController::RoutingError
In your local environment, this is the error generated for page not
found. In production, this leads to your 404 page.
Another place this is generated is when URL's on the page fail to be
created. For instance, a failing link_to("clients", clients_path).
These are things you want to be notified about. In this case the
errors are wrapped in ActionView::Template::Error. However I believe
the bug referenced when checking the ignore list is
ActionController::RoutingError due to this "unwrap" code in the
HoptoadNotifier module:
def unwrap_exception(exception)
if exception.respond_to?(:original_exception)
exception.original_exception
elsif exception.respond_to?(:continued_exception)
exception.continued_exception
else
exception
end
end
The notification is to go out referencing the "original_exception",
which in this case is ActionController::RoutingError. And the default
behavior in hoptoad_notifier is to ignore this error. I wonder if
Rails2 did not work in quite this way?
A temporary fix is to update the HoptoadNotifier configuration and
remove that class:
config.ignore_only = %w{
AbstractController::ActionNotFound
ActiveRecord::RecordNotFound
ActionController::InvalidAuthenticityToken
ActionController::UnknownAction
CGI::Session::CookieStore::TamperedWithCookie
}
Given this configuration, it appears the only
ActionController::RoutingErrors that get passed all the way to
HoptoadNotifier are of the "bad link" variety, as "page not found"
errors do not get passed on. They probably get rescued by Rails3
before they can get to HoptoadNotifier.
I'm hesitant to provide a pull request removing that class because I'm
unsure how Rails2 would react to it. Anyway, hopefully this provides a
good deal of information to isolate the problem with the gem/plugin.
Let me know if I can be of further help,
--
Barry