[katello-devel] before_filter behavior and notices
Brad Buckingham
bbuckingham at redhat.com
Wed Jul 20 14:26:04 UTC 2011
On 07/20/2011 10:17 AM, Lukas Zapletal wrote:
> On 07/20/2011 04:14 PM, Dmitri Dolguikh wrote:
>> You could also add a common exception handler to ApplicationContoller
>> using rescue_from.
>
> Yeah, we do the same in the api_controller (which is
> ApplicationController for API controllers):
>
> rescue_from HttpErrors::NotFound, :with => proc { |e|
> render_exception(404, e) }
>
> LZ
>
Good suggestions. To handle the generic case, they could be added to
ApplicationController; however, there are a few controllers that are
handled a little differently (but only minor differences).
I had actually forgotten about rescue_from. It also bypasses the filter
chain, but we can still leverage something like execute_after_filters
for such cases.
More information about the katello-devel
mailing list