This project is archived and is in readonly mode.
Fix to enable better error message on middleware.insert_before
Reported by Nate Wiger | January 10th, 2010 @ 02:25 AM
Patch against Rails 3.0.pre (edge)
Without the patch, if you try this:
...middleware.insert_before(
Non::Existent::Middleware,
My::Middleware
)
You get:
Exiting
/Users/nwiger/Workspace/op/proto/fbapp/vendor/gems/dirs/rails/actionpack/lib/action_dispatch/middleware/stack.rb:90:in
insert': no implicit conversion from nil to integer
(TypeError)
from /Users/nwiger/Workspace/op/proto/fbapp/vendor/gems/dirs/rails/actionpack/lib/action_dispatch/middleware/stack.rb:90:in `insert'
But insert_after already has better handling, so I just adapted that to insert_before. So with the patch, you now get:
Exiting
/Users/nwiger/Workspace/op/proto/fbapp/vendor/gems/dirs/rails/actionpack/lib/action_dispatch/middleware/stack.rb:89:in
insert': No such middleware to insert before:
Non::Existent::Middleware (RuntimeError)
Comments and changes to this ticket
-
José Valim July 20th, 2010 @ 11:15 PM
- Assigned user set to José Valim
- Importance changed from to Low
-
Repository July 21st, 2010 @ 02:23 PM
- State changed from new to resolved
(from [9dfe9fa693c98a828dae6ad96eb9798bbdea7d81]) Ensure insert_before in middleware stack raises a meaningful error message [#3679 state:resolved] http://github.com/rails/rails/commit/9dfe9fa693c98a828dae6ad96eb979...
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
Attachments
Tags
Referenced by
- 3679 Fix to enable better error message on middleware.insert_before (from [9dfe9fa693c98a828dae6ad96eb9798bbdea7d81]) Ensure ...