Re: Configuring proper sequence of Rack middlewares ...

Kedar Mhaswade
Mon, 19 Nov 2012 13:01:47 -0000

>
>
>>
> The best way to visualize the process here is to imagine the request comes
> in at the *top* of the middleware stack (AD::Static here) and is passed
> down to successive middlewares until it generates a response. The response
> then flows back *up* the stack until it gets to the top and is handed to
> the web server for delivery to the user.
>
> Short story shorter, you need to put them in the opposite order -
> ShowExceptions is rescuing the exception so ExceptionNotifier never sees
it.
>

Thank you, Matt Jones.

I changed the sequence so that ExceptionNotifier middleware is below the
ShowExceptions middleware in the stack (as reported by rake middleware).

In this case however, I am not seeing the desired effect. Is it because
ShowExceptions::render_exeption_with_template, as written, actually renders
the response (the formatted error page) and does not re-raise the
exception? Should I rewrite ShowExceptions::render_exeption_with_template
to re-raise the exception in case of certain errors (e.g. 500 and not 404)?

Regards,
Kedar


> --Matt Jones
>

--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit