Skip to content

Instantly share code, notes, and snippets.

@sorokadima
Last active January 2, 2020 09:49
Show Gist options
  • Save sorokadima/5faa80a4860b0cc301d3f80eaf6703a9 to your computer and use it in GitHub Desktop.
Save sorokadima/5faa80a4860b0cc301d3f80eaf6703a9 to your computer and use it in GitHub Desktop.
Rails Catch Exception (Ruby On Rails try catch)
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