In Rails 5, when a callback needs to cancel later callbacks, the recommended process is documented as "you should explicitly throw :abort
."
My question is: how is it recommended that this exception be caught?
My current solution is to catch UncaughtThrowError
in my ApplicationController
- given the way it's documented, I thought this feature would trigger some magic in Rails or a Rack middleware to immediately move to the rendering (ActionView
) phase.