Skip to content

Instantly share code, notes, and snippets.

@rafarubert
Created May 14, 2012 17:27
Show Gist options
  • Save rafarubert/2695196 to your computer and use it in GitHub Desktop.
Save rafarubert/2695196 to your computer and use it in GitHub Desktop.
def rescue_action_in_public(exception)
if exception
deliverer = self.class.exception_data
data = case deliverer
when nil then {}
when Symbol then send(deliverer)
when Proc then deliverer.call(self)
end
ExceptionNotifier.deliver_exception_notification(exception, self,request, data)
flash[:error] = "Blah";redirect_to '/'
else
super
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment