#16 open
José Valim

Exception Notifiable should not override rescue_action_in_public

Reported by José Valim | June 10th, 2008 @ 04:44 PM

In its actual implementation, Exception Notifiable overrides rescue_action_in_public. So if the user overrides it also, or the user implementation or the plugin won't work.

The solution is easy: use alias_method_chain.

Patch attached.

Comments and changes to this ticket

  • Jeremy Kemper

    Jeremy Kemper June 10th, 2008 @ 06:19 PM

    users can call super in their overridden method

  • José Valim

    José Valim June 10th, 2008 @ 06:29 PM

    Yes, they can! =)

    But if I call super, Exception Notifiable will try to render the page and not only send the e-mail.

    I'm some cases, it's worse.

    For example, I'm localizing my application so I have 404.en.html and 404.br.html. Exception Notifiable will try to render 404.html, that doesn't exist and it will break my application.

    If You look to Exception Notifiable, it doesn't even take in consideration where is the public directory:

    "#{RAILS_ROOT}/public/404.html"

    What if the user change the public directory and public/404.html is not there also?

  • Jeremy Kemper

    Jeremy Kemper June 10th, 2008 @ 07:25 PM

    • → State changed from “new” to “open”

    Gotcha. Looks good :)

Please Login or create a free account to add a new comment.

You can update this ticket by sending an email to from your email client. (help)

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

People watching this ticket