Last active
December 20, 2019 18:09
-
-
Save RayParkerBassPlayer/c97a36a271cc0fc3d50b1611e962f07d to your computer and use it in GitHub Desktop.
Default Exception Handling, Rails
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rescue_from Exception, :with => :handle_exceptions | |
def handle_exceptions(exception) | |
cookies[:exception] = exception.message | |
Rails.logger.error exception.backtrace.join("\n") | |
redirect_to error_page_path | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment