Last active
January 2, 2020 09:49
-
-
Save sorokadima/5faa80a4860b0cc301d3f80eaf6703a9 to your computer and use it in GitHub Desktop.
Rails Catch Exception (Ruby On Rails try catch)
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
def res params | |
begin | |
# do something | |
Rails.logger.info "debug #{Time.now.to_datetime}" | |
Rails.logger.info params | |
rescue Exception => e | |
Rails.logger.info "debug_Exception #{Time.now.to_datetime}" | |
Rails.logger.info e.message | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment