"use MyMiddleware" inside of a "configure" block in development mode

0 views
Skip to first unread message

Chris Sepic

unread,
Aug 7, 2009, 12:16:12 PM8/7/09
to sinatrarb
Some sample code:

configure :development, :stage do
use Rack::ShowExceptions
end

configure :production do
use Rack::MailExceptions { ... }
end

Calling 'use' inside of a configure block in development mode (works
with other envs) will not include the middleware. Could someone
explain why? I'm not sure if this is even the way to go about it, as I
did see in the docs that 'use' should be top level.

Thanks, Chris

Simon Rozet

unread,
Aug 7, 2009, 3:52:21 PM8/7/09
to sina...@googlegroups.com

I didn't try but I think that's because Rack::ShowExceptions gets
overridden by Sinatra::ShowExceptions which is enabled in
development env.


--
Simon Rozet <si...@rozet.name> http://atonie.org

Reply all
Reply to author
Forward
0 new messages