This project is archived and is in readonly mode.
rescue_from changes causing issues
Reported by Trevor Turk | July 20th, 2008 @ 10:37 PM | in 2.x
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.
Comments and changes to this ticket
-
Trevor Turk July 20th, 2008 @ 10:40 PM
I should have attached an example error I'm receiving in my tests:
This exception should be caught as described in the test:
-
Trevor Turk July 20th, 2008 @ 11:14 PM
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.
-
Pratik July 20th, 2008 @ 11:51 PM
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
-
Pratik July 20th, 2008 @ 11:52 PM
- State changed from new to invalid
-
Trevor Turk July 21st, 2008 @ 12:11 AM
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.
-
Pratik July 21st, 2008 @ 12:12 AM
Yeah, old generators added that. I wonder if there's a clean way to throw the warning.
-
Trevor Turk July 21st, 2008 @ 01:01 AM
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:
-
Pratik July 21st, 2008 @ 01:15 AM
You'll need to test it in an integration test as functional tests are
tied to a specific controller.
-
Trevor Turk July 21st, 2008 @ 01:47 AM
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!
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Referenced by
- 835 rescue_from handlers are not being honored in functional tests In other words, this is not the same issue as #664.