Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

rescue_from changes causing issues

#664

I'm trying to upgrade an app to edge to dig into the new i18n stuff, and I'm finding that my rescue_from calls aren't working. I'm wondering if it has something to do with this:

http://m.onkey.org/2008/7/20/res...

and

http://github.com/rails/rails/co...

Perhaps I'm doing something wrong, but things are working fine in 2.1 and I can't seem to figure out if I need to change anything. Here's how I'm doing things (with a combo of two files):

http://github.com/trevorturk/el-...

and

http://github.com/trevorturk/el-...

My apologies if this is a mistake on my end. I haven't been able to figure out what I could be doing wrong.

Reported by Trevor Turk · July 20th, 2008 @ 10:37 PM

State: invalid
Milestone: 2.x
Assigned to: Pratik Pratik
Importance: none

Activity

  1. Trevor Turk
    Trevor Turk

    I should have attached an example error I'm receiving in my tests:

    http://pastie.org/237545

    This exception should be caught as described in the test:

    http://pastie.org/237546

    July 20th, 2008 @ 10:40 PM

  2. Pratik
    Pratik

    Trevor,

    Does it work if you revert that changeset ?

    July 20th, 2008 @ 10:55 PM

  3. Trevor Turk
    Trevor Turk

    Yeah, if I vendor from this commit:

    http://github.com/rails/rails/co...

    (which is before the one we're talking about) then things work fine. Actually, the calendar_date_select plugin is causing some errors, but the errors that are making me think that rescue_from wasn't working are gone.

    I can't guarantee that I'm doing everything the way you're supposed to, but it does look suspiciously related to that commit.

    July 20th, 2008 @ 11:14 PM

  4. Pratik
    Pratik

    This happening because you have following in your tests :

    # Re-raise errors caught by the controller.
    class HomeController; def rescue_action(e) raise e end; end
    

    July 20th, 2008 @ 11:51 PM

  5. Pratik
    Pratik
    • State changed from new to invalid

    July 20th, 2008 @ 11:52 PM

  6. Trevor Turk
    Trevor Turk

    I see. Thanks very much for tracking that down.

    Perhaps this would be worth mentioning as a gotcha on the next release? I'm pretty sure that the Rails generator added that stuff in there for me, so it could be that this problem would bite a lot of people.

    I'll clean up my functional tests to look like what's generated with edge rails now. Thanks again.

    July 21st, 2008 @ 12:11 AM

  7. Pratik
    Pratik

    Yeah, old generators added that. I wonder if there's a clean way to throw the warning.

    July 21st, 2008 @ 12:12 AM

  8. Trevor Turk
    Trevor Turk

    Sorry to be a bother, but I'm still not able to get this working.

    I've made a new app on rails edge, and I'm able to get exceptions rescued in development mode, but the tests are still failing. Perhaps I'm doing something obvious wrong, but I can't seem to figure it out.

    Here's the commit that shows what I'm doing:

    http://github.com/trevorturk/rai...

    ...and the test results:

    http://pastie.org/237594

    July 21st, 2008 @ 01:01 AM

  9. Pratik
    Pratik

    You'll need to test it in an integration test as functional tests are

    tied to a specific controller.

    July 21st, 2008 @ 01:15 AM

  10. Trevor Turk
    Trevor Turk

    Ahh, that finally did it. Thanks again for your help, and I'm very sorry to have bothered you. I do think that this change might impact people with older applications that use generated tests, but it's easy enough to fix once you know what's going on. Thanks!

    July 21st, 2008 @ 01:47 AM