This project is archived and is in readonly mode.

#1684 ✓resolved
LacKac

Routing Errors won't get rescued properly

Reported by LacKac | January 2nd, 2009 @ 12:23 AM

When requesting an uri with no matching route the application raises the following exception:


      You have a nil object when you didn't expect it!
The error occurred while evaluating nil.request=
    /Users/LacKac/Working/Lab/test/vendor/rails/actionpack/lib/action_controller/base.rb:518:in `process_without_filters'

Reproducing the error is simple:

The problem is that the call_with_exception method won't find the original request and response objects in the env hash because they're not yet set. I attached a patch which solves the problem by creating new request and response objects if they're not set. It's basically the same as in this commit by josh: http://github.com/rails/rails/co...

I couldn't come up with a test since not having those two env keys set will create new request and response objects wich will make it impossible to test based on changes made to a TestResponse instance.

Comments and changes to this ticket

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

Pages