could someone explain the code in catch_exceptions?
i have difficulties to understand.
thanks
class ApplicationController < ActionController::Base
around_filter :catch_exceptions
private
def catch_exceptions
yield
rescue => exception
logger.debug "Caught exception! #{exception}"
raise
end
end
Simple.
You need first to understand the concept of the around_filter. It puts something AROUND a method call. Also you need to understand YIELD, that is executing a block.
so if you have something like an Index action.
that means it will be sent as a block to that around_filter, which will execute that just as if it were…