views:

38

answers:

1

How could I disable or configure the HoptoadNotifier per controller? Background is that I configured the notifier to report "Method not allowed" exception, eg this is raised when an action is accessed with GET instead of POST.

But I have an autocomplete controller which is scanned by bots (probably to find exploits) by sending GET requests to my controller instead of POST (with all sorts of strange parameters). So I want to disable the notifier for just this exception, this action, or this controller.

Solved: Thanks to @Tanel I did the following which seems to work:

def rescue_action_in_public exception
  if exception.is_a? ActionController::MethodNotAllowed
    rescue_action_in_public_without_hoptoad exception
  else
    super exception
  end
end
A: 

Perhaps overriding the rescue_action_in_public in the specific controller?

That's the method Hoptoad uses to catch its exceptions.

Tanel Suurhans
Thanx for the pointer, I updated my question with the proposed solution.
hurikhan77