in my ApplicationController, I have
rescue_from StorageExceptions::AuthorizationFailed, :with => handle_auth_error
def handle_auth_error
redirect_to error_path(403)
end
but the code is not catching this error. I have checked that what is being caught is NameError with message: "uncaught throw `StorageExceptions::AuthorizationFailed'"
Why is this and how can I catch the actual error?
I had trouble getting the
rescue_from ..., :with => ...
syntax working in my Rails (2.3.8) app, too - I solved it by using the alternativerescue_from ... do ... end
form:I never figured out why the first form never worked, though...
Hope this helps!